import React, { useEffect } from "react"; import { useRouter } from "next/router"; // icons import { Plus } from "lucide-react"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // hooks import useMyIssuesFilters from "hooks/my-issues/use-my-issues-filter"; // components import { MyIssuesView, MyIssuesViewOptions } from "components/issues"; // ui import { Breadcrumbs, BreadcrumbItem, Button } from "@plane/ui"; // types import type { NextPage } from "next"; import useUser from "hooks/use-user"; const MyIssuesPage: NextPage = () => { const router = useRouter(); const { workspaceSlug } = router.query; const { user } = useUser(); const { filters, setFilters } = useMyIssuesFilters(workspaceSlug?.toString()); const tabsList = [ { key: "assigned", label: "Assigned", selected: (filters?.assignees ?? []).length > 0, onClick: () => { setFilters({ assignees: [user?.id ?? ""], created_by: null, subscriber: null, }); }, }, { key: "created", label: "Created", selected: (filters?.created_by ?? []).length > 0, onClick: () => { setFilters({ assignees: null, created_by: [user?.id ?? ""], subscriber: null, }); }, }, { key: "subscribed", label: "Subscribed", selected: (filters?.subscriber ?? []).length > 0, onClick: () => { setFilters({ assignees: null, created_by: null, subscriber: [user?.id ?? ""], }); }, }, ]; useEffect(() => { if (!filters || !user) return; if (!filters.assignees && !filters.created_by && !filters.subscriber) { setFilters({ assignees: [user.id], }); return; } }, [filters, setFilters, user]); return ( router.back()}> } right={
} >
{tabsList.map((tab) => ( ))}
); }; export default MyIssuesPage;