import React from "react"; import { useRouter } from "next/router"; // hooks import useIssuesProperties from "lib/hooks/useIssuesProperties"; // headless ui import { Popover, Transition } from "@headlessui/react"; // ui import { CustomMenu } from "ui"; // icons import { ChevronDownIcon } from "@heroicons/react/24/outline"; // types import { IIssue, NestedKeyOf, Properties } from "types"; // common import { classNames, replaceUnderscoreIfSnakeCase } from "constants/common"; // constants import { filterIssueOptions, groupByOptions, orderByOptions } from "constants/"; type Props = { groupByProperty: NestedKeyOf | null; setGroupByProperty: (property: NestedKeyOf | null) => void; orderBy: NestedKeyOf | null; setOrderBy: (property: NestedKeyOf | null) => void; filterIssue: "activeIssue" | "backlogIssue" | null; setFilterIssue: (property: "activeIssue" | "backlogIssue" | null) => void; resetFilterToDefault: () => void; setNewFilterDefaultView: () => void; }; const View: React.FC = ({ groupByProperty, setGroupByProperty, orderBy, setOrderBy, filterIssue, setFilterIssue, resetFilterToDefault, setNewFilterDefaultView, }) => { const router = useRouter(); const { workspaceSlug, projectId } = router.query; const [properties, setProperties] = useIssuesProperties( workspaceSlug as string, projectId as string ); return ( <> {({ open }) => ( <> View

Group by

option.key === groupByProperty)?.name ?? "Select" } width="lg" > {groupByOptions.map((option) => ( setGroupByProperty(option.key)} > {option.name} ))}

Order by

option.key === orderBy)?.name ?? "Select" } width="lg" > {orderByOptions.map((option) => groupByProperty === "priority" && option.key === "priority" ? null : ( setOrderBy(option.key)} > {option.name} ) )}

Issue type

option.key === filterIssue)?.name ?? "Select" } width="lg" > {filterIssueOptions.map((option) => ( setFilterIssue(option.key)} > {option.name} ))}

Display Properties

{Object.keys(properties).map((key) => ( ))}
)}
); }; export default View;