2023-12-04 06:41:36 +00:00
|
|
|
import { ReactElement } from "react";
|
2023-06-23 07:49:26 +00:00
|
|
|
import { useRouter } from "next/router";
|
2023-12-04 06:41:36 +00:00
|
|
|
import useSWR from "swr";
|
2023-06-16 13:27:17 +00:00
|
|
|
// hooks
|
2023-12-04 06:41:36 +00:00
|
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
2023-06-16 13:27:17 +00:00
|
|
|
// layouts
|
2023-12-04 06:41:36 +00:00
|
|
|
import { AppLayout } from "layouts/app-layout";
|
2023-06-16 13:27:17 +00:00
|
|
|
// components
|
2023-12-04 06:41:36 +00:00
|
|
|
import { InboxActionsHeader, InboxMainContent, InboxIssuesListSidebar } from "components/inbox";
|
|
|
|
import { ProjectInboxHeader } from "components/headers";
|
2023-06-16 13:27:17 +00:00
|
|
|
// types
|
2023-12-04 06:41:36 +00:00
|
|
|
import { NextPageWithLayout } from "types/app";
|
2023-06-16 13:27:17 +00:00
|
|
|
|
2023-12-04 06:41:36 +00:00
|
|
|
const ProjectInboxPage: NextPageWithLayout = () => {
|
2023-06-16 13:27:17 +00:00
|
|
|
const router = useRouter();
|
2023-12-04 06:41:36 +00:00
|
|
|
const { workspaceSlug, projectId, inboxId } = router.query;
|
|
|
|
|
|
|
|
const { inboxFilters: inboxFiltersStore } = useMobxStore();
|
2023-06-16 13:27:17 +00:00
|
|
|
|
2023-12-04 06:41:36 +00:00
|
|
|
useSWR(
|
|
|
|
workspaceSlug && projectId && inboxId ? `INBOX_FILTERS_${inboxId.toString()}` : null,
|
|
|
|
workspaceSlug && projectId && inboxId
|
|
|
|
? () => inboxFiltersStore.fetchInboxFilters(workspaceSlug.toString(), projectId.toString(), inboxId.toString())
|
|
|
|
: null
|
|
|
|
);
|
2023-06-16 13:27:17 +00:00
|
|
|
|
|
|
|
return (
|
2023-12-04 06:41:36 +00:00
|
|
|
<div className="flex flex-col h-full">
|
|
|
|
<InboxActionsHeader />
|
|
|
|
<div className="grid grid-cols-4 flex-1 divide-x divide-custom-border-200 overflow-hidden">
|
|
|
|
<InboxIssuesListSidebar />
|
|
|
|
<div className="col-span-3 h-full overflow-auto">
|
|
|
|
<InboxMainContent />
|
2023-06-23 07:49:26 +00:00
|
|
|
</div>
|
2023-12-04 06:41:36 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
ProjectInboxPage.getLayout = function getLayout(page: ReactElement) {
|
|
|
|
return (
|
|
|
|
<AppLayout header={<ProjectInboxHeader />} withProjectWrapper>
|
|
|
|
{page}
|
|
|
|
</AppLayout>
|
2023-06-16 13:27:17 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2023-12-04 06:41:36 +00:00
|
|
|
export default ProjectInboxPage;
|