2023-11-10 12:06:40 +03:00
|
|
|
import * as React from "react";
|
2023-11-16 00:40:35 +03:00
|
|
|
import { AllProjectStore } from "./all_projects_store";
|
|
|
|
import { ProjectRepository } from "../data/project_repository";
|
|
|
|
import { LoadPage } from "../../../core/ui/pages/load_page";
|
|
|
|
import { observer } from "mobx-react-lite";
|
2023-11-10 12:06:40 +03:00
|
|
|
import { SelectProjectScreenPath } from "../../select_project/presentation/select_project";
|
|
|
|
|
|
|
|
export const AllProjectScreenPath = "/";
|
2023-11-20 00:48:40 +03:00
|
|
|
|
2023-11-16 00:40:35 +03:00
|
|
|
export const AllProjectScreen: React.FunctionComponent = observer(() => {
|
|
|
|
const [allProjectStore] = React.useState(
|
|
|
|
() => new AllProjectStore(new ProjectRepository())
|
|
|
|
);
|
|
|
|
|
2023-11-10 12:06:40 +03:00
|
|
|
return (
|
|
|
|
<>
|
2023-11-16 00:40:35 +03:00
|
|
|
<LoadPage
|
2023-11-14 20:44:06 +03:00
|
|
|
largeText={"Projects"}
|
2023-11-16 00:40:35 +03:00
|
|
|
needBackButton={false}
|
|
|
|
minText="create project?"
|
|
|
|
path={SelectProjectScreenPath}
|
|
|
|
isError={allProjectStore.isError}
|
|
|
|
isLoading={allProjectStore.isLoading}
|
|
|
|
children={
|
|
|
|
<div>
|
|
|
|
{allProjectStore.projectsModels?.map((el) => {
|
|
|
|
return <div>{el.description}</div>;
|
|
|
|
})}
|
|
|
|
</div>
|
|
|
|
}
|
2023-11-10 12:06:40 +03:00
|
|
|
/>
|
|
|
|
</>
|
|
|
|
);
|
2023-11-16 00:40:35 +03:00
|
|
|
});
|