fix: projects editor to selected project editor, moved attributes editor

This commit is contained in:
2025-03-02 16:49:28 +04:00
parent 17e6c5f23a
commit e151e4bc5e
44 changed files with 476 additions and 512 deletions

26
src/hooks/useProjects.tsx Normal file
View File

@@ -0,0 +1,26 @@
import { useEffect, useState } from "react";
import { type FullProjectSchema, ProjectService } from "../client";
const useProjects = () => {
const [projects, setProjects] = useState<FullProjectSchema[]>([]);
const refetchProjects = () => {
ProjectService.getProjects()
.then(data => {
setProjects(data.projects);
})
.catch(e => console.log(e));
};
useEffect(() => {
refetchProjects();
}, []);
return {
projects,
refetchProjects,
};
};
export default useProjects;