2023-11-02 18:27:44 +00:00
|
|
|
import { ReactElement } from "react";
|
2023-04-06 09:39:24 +00:00
|
|
|
// layouts
|
2023-10-25 10:18:57 +00:00
|
|
|
import { AppLayout } from "layouts/app-layout";
|
2023-11-01 08:15:04 +00:00
|
|
|
import { ProjectSettingLayout } from "layouts/settings-layout";
|
2023-04-06 09:39:24 +00:00
|
|
|
// components
|
2023-10-18 13:47:02 +00:00
|
|
|
import { ProjectSettingHeader } from "components/headers";
|
2023-11-20 10:28:40 +00:00
|
|
|
import { EstimatesList } from "components/estimates";
|
2023-04-06 09:39:24 +00:00
|
|
|
// types
|
2023-11-02 18:27:44 +00:00
|
|
|
import { NextPageWithLayout } from "types/app";
|
2023-12-04 14:33:23 +00:00
|
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
|
|
import { EUserWorkspaceRoles } from "constants/workspace";
|
|
|
|
import { observer } from "mobx-react-lite";
|
2023-04-11 12:24:01 +00:00
|
|
|
|
2023-12-04 14:33:23 +00:00
|
|
|
const EstimatesSettingsPage: NextPageWithLayout = observer(() => {
|
|
|
|
const {
|
|
|
|
user: { currentProjectRole },
|
|
|
|
} = useMobxStore();
|
|
|
|
|
|
|
|
const isAdmin = currentProjectRole === EUserWorkspaceRoles.ADMIN;
|
|
|
|
|
|
|
|
return (
|
2023-12-10 10:18:10 +00:00
|
|
|
<div className={`w-full overflow-y-auto py-8 pr-9 ${isAdmin ? "" : "pointer-events-none opacity-60"}`}>
|
2023-12-04 14:33:23 +00:00
|
|
|
<EstimatesList />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
});
|
2023-04-06 09:39:24 +00:00
|
|
|
|
2023-11-02 18:27:44 +00:00
|
|
|
EstimatesSettingsPage.getLayout = function getLayout(page: ReactElement) {
|
|
|
|
return (
|
|
|
|
<AppLayout header={<ProjectSettingHeader title="Estimates Settings" />} withProjectWrapper>
|
2023-11-14 13:03:01 +00:00
|
|
|
<ProjectSettingLayout>{page}</ProjectSettingLayout>
|
2023-11-02 18:27:44 +00:00
|
|
|
</AppLayout>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default EstimatesSettingsPage;
|