// react import React, { useState } from "react"; // next import type { NextPage } from "next"; // swr import useSWR from "swr"; // layouts import ProjectLayout from "layouts/ProjectLayout"; // hooks import useUser from "lib/hooks/useUser"; // components import CreateUpdateIssuesModal from "components/project/issues/CreateUpdateIssueModal"; // ui import { Spinner } from "ui"; import { BreadcrumbItem, Breadcrumbs } from "ui/Breadcrumbs"; import { EmptySpace, EmptySpaceItem } from "ui/EmptySpace"; import HeaderButton from "ui/HeaderButton"; // icons import { PlusIcon, RectangleStackIcon } from "@heroicons/react/24/outline"; // services import userService from "lib/services/user.service"; // types import { IIssue } from "types"; // constants import ChangeStateDropdown from "components/project/issues/my-issues/ChangeStateDropdown"; import { USER_ISSUE } from "constants/fetch-keys"; import { classNames } from "constants/common"; const MyIssues: NextPage = () => { const [isOpen, setIsOpen] = useState(false); const { user } = useUser(); const { data: myIssues } = useSWR( user ? USER_ISSUE : null, user ? () => userService.userIssues() : null ); return (
{myIssues ? ( <> {myIssues.length > 0 ? ( <>

My Issues

{ const e = new KeyboardEvent("keydown", { key: "i", ctrlKey: true, }); document.dispatchEvent(e); }} />
{myIssues.map((myIssue, index) => ( ))}
NAME DESCRIPTION PROJECT PRIORITY STATUS
{myIssue.name} {myIssue.description} {myIssue.project_detail.name}
{`(${myIssue.project_detail.identifier}-${myIssue.sequence_id})`}
{myIssue.priority}
) : (
Use{" "}
Ctrl/Command + I
{" "} shortcut to create a new issue } Icon={PlusIcon} action={() => setIsOpen(true)} />
)} ) : (
)}
); }; export default MyIssues;