import React from "react"; import { useRouter } from "next/router"; // headless ui import { Disclosure, Popover, Transition } from "@headlessui/react"; // icons import { ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline"; // images import emptyMyIssues from "public/empty-state/my-issues.svg"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; // hooks import useIssues from "hooks/use-issues"; // ui import { Spinner, PrimaryButton, EmptyState } from "components/ui"; import { Breadcrumbs, BreadcrumbItem } from "components/breadcrumbs"; // hooks import useMyIssuesProperties from "hooks/use-my-issues-filter"; // types import { IIssue, Properties } from "types"; // components import { MyIssuesListItem } from "components/issues"; // helpers import { replaceUnderscoreIfSnakeCase } from "helpers/string.helper"; // types import type { NextPage } from "next"; import useProjects from "hooks/use-projects"; const MyIssuesPage: NextPage = () => { const router = useRouter(); const { workspaceSlug } = router.query; const { myIssues } = useIssues(workspaceSlug as string); const { projects } = useProjects(); const [properties, setProperties] = useMyIssuesProperties(workspaceSlug as string); return ( } right={
{myIssues && myIssues.length > 0 && ( {({ open }) => ( <> View

Properties

{Object.keys(properties).map((key) => { if (key === "estimate" || key === "created_on" || key === "updated_on") return null; return ( ); })}
)}
)} { const e = new KeyboardEvent("keydown", { key: "c" }); document.dispatchEvent(e); }} > Add Issue
} >
{myIssues ? ( <> {myIssues.length > 0 ? ( {({ open }) => (

My Issues

{myIssues.length}
{myIssues.map((issue: IIssue) => ( ))}
)}
) : ( 0 ? "You don't have any issue assigned to you yet" : "Issues assigned to you will appear here" : "" } description={ projects ? projects.length > 0 ? "Keep track of your work in a single place." : "Let's create your first project and add issues that you want to accomplish." : "" } image={emptyMyIssues} buttonText={projects ? (projects.length > 0 ? "New Issue" : "New Project") : ""} buttonIcon={} onClick={() => { let e: KeyboardEvent; if (projects && projects.length > 0) e = new KeyboardEvent("keydown", { key: "c", }); else e = new KeyboardEvent("keydown", { key: "p", }); document.dispatchEvent(e); }} /> )} ) : (
)}
); }; export default MyIssuesPage;