2024-01-24 15:03:54 +00:00
|
|
|
import { FC } from "react";
|
2024-01-25 08:11:02 +00:00
|
|
|
import { observer } from "mobx-react";
|
2024-03-06 13:09:14 +00:00
|
|
|
import { Inbox } from "lucide-react";
|
2024-01-25 08:11:02 +00:00
|
|
|
// hooks
|
2024-03-19 14:38:35 +00:00
|
|
|
import { InboxSidebarLoader } from "@/components/ui";
|
|
|
|
import { useInboxIssues } from "@/hooks/store";
|
2024-01-25 08:11:02 +00:00
|
|
|
// ui
|
2024-01-24 15:03:54 +00:00
|
|
|
// components
|
|
|
|
import { InboxIssueList, InboxIssueFilterSelection, InboxIssueAppliedFilter } from "../";
|
|
|
|
|
|
|
|
type TInboxSidebarRoot = {
|
|
|
|
workspaceSlug: string;
|
|
|
|
projectId: string;
|
|
|
|
inboxId: string;
|
|
|
|
};
|
|
|
|
|
2024-01-25 08:11:02 +00:00
|
|
|
export const InboxSidebarRoot: FC<TInboxSidebarRoot> = observer((props) => {
|
2024-01-24 15:03:54 +00:00
|
|
|
const { workspaceSlug, projectId, inboxId } = props;
|
2024-01-25 08:11:02 +00:00
|
|
|
// store hooks
|
|
|
|
const {
|
|
|
|
issues: { loader },
|
|
|
|
} = useInboxIssues();
|
2024-01-24 15:03:54 +00:00
|
|
|
|
2024-02-19 15:37:43 +00:00
|
|
|
if (loader === "init-loader") {
|
|
|
|
return <InboxSidebarLoader />;
|
|
|
|
}
|
|
|
|
|
2024-01-24 15:03:54 +00:00
|
|
|
return (
|
|
|
|
<div className="relative flex flex-col w-full h-full">
|
2024-01-25 08:11:02 +00:00
|
|
|
<div className="flex-shrink-0 w-full h-[50px] relative flex justify-between items-center gap-2 p-2 px-3 border-b border-custom-border-300">
|
2024-01-24 15:03:54 +00:00
|
|
|
<div className="relative flex items-center gap-1">
|
|
|
|
<div className="relative w-6 h-6 flex justify-center items-center rounded bg-custom-background-80">
|
|
|
|
<Inbox className="w-4 h-4" />
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-01-25 08:11:02 +00:00
|
|
|
<div className="z-20">
|
2024-01-24 15:03:54 +00:00
|
|
|
<InboxIssueFilterSelection workspaceSlug={workspaceSlug} projectId={projectId} inboxId={inboxId} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="w-full h-auto">
|
|
|
|
<InboxIssueAppliedFilter workspaceSlug={workspaceSlug} projectId={projectId} inboxId={inboxId} />
|
|
|
|
</div>
|
|
|
|
|
2024-02-19 15:37:43 +00:00
|
|
|
<div className="w-full h-full overflow-hidden">
|
|
|
|
<InboxIssueList workspaceSlug={workspaceSlug} projectId={projectId} inboxId={inboxId} />
|
|
|
|
</div>
|
2024-01-24 15:03:54 +00:00
|
|
|
</div>
|
|
|
|
);
|
2024-01-25 08:11:02 +00:00
|
|
|
});
|