2023-11-10 12:06:40 +03:00
|
|
|
|
import * as React from "react";
|
2023-11-16 00:40:35 +03:00
|
|
|
|
|
2023-11-10 12:06:40 +03:00
|
|
|
|
import { observer } from "mobx-react-lite";
|
|
|
|
|
import { LoadPage } from "../../../core/ui/pages/load_page";
|
2023-11-14 20:44:06 +03:00
|
|
|
|
import { CreateProjectScreenPath } from "../../create_project/create_project_screen";
|
2023-11-16 00:40:35 +03:00
|
|
|
|
import { SelectProjectStore } from "./select_project_store";
|
|
|
|
|
import { SelectProjectRepository } from "../data/select_project_repository";
|
2023-11-10 12:06:40 +03:00
|
|
|
|
|
|
|
|
|
export const SelectProjectScreenPath = "/select_project";
|
|
|
|
|
|
|
|
|
|
export const SelectProjectScreen: React.FunctionComponent = observer(() => {
|
2023-11-16 00:40:35 +03:00
|
|
|
|
const [selectProjectStore] = React.useState(
|
|
|
|
|
() => new SelectProjectStore(new SelectProjectRepository())
|
|
|
|
|
);
|
|
|
|
|
|
2023-11-10 12:06:40 +03:00
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<LoadPage
|
2023-11-14 20:44:06 +03:00
|
|
|
|
path={CreateProjectScreenPath}
|
2023-11-10 12:06:40 +03:00
|
|
|
|
largeText={"Select project"}
|
|
|
|
|
minText={"add new project?"}
|
|
|
|
|
isLoading={selectProjectStore.isLoading}
|
|
|
|
|
isError={selectProjectStore.isError}
|
|
|
|
|
children={selectProjectStore.projects.map((el) => {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<div>{el.description}</div>
|
|
|
|
|
<div>+(РЕАЛИЗУЙ ТУТ ПЛЮСИК БЛЯТЬ ИЛИ КНОПКУ)</div>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
});
|