import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; // constants import { issueViews } from "constants/data"; // interfaces import { TIssueBoardKeys } from "store/types"; // mobx import { useMobxStore } from "lib/mobx/store-provider"; import { RootStore } from "store/root"; export const NavbarIssueBoardView = observer(() => { const store: RootStore = useMobxStore(); const router = useRouter(); const { workspace_slug, project_slug } = router.query as { workspace_slug: string; project_slug: string }; const handleCurrentBoardView = (boardView: TIssueBoardKeys) => { store?.issue?.setCurrentIssueBoardView(boardView); router.replace( `/${workspace_slug}/${project_slug}?board=${boardView}${ store?.issue?.userSelectedLabels && store?.issue?.userSelectedLabels.length > 0 ? `&labels=${store?.issue?.userSelectedLabels.join(",")}` : "" }${ store?.issue?.userSelectedPriorities && store?.issue?.userSelectedPriorities.length > 0 ? `&priorities=${store?.issue?.userSelectedPriorities.join(",")}` : "" }${ store?.issue?.userSelectedStates && store?.issue?.userSelectedStates.length > 0 ? `&states=${store?.issue?.userSelectedStates.join(",")}` : "" }` ); }; return ( <> {store?.project?.workspaceProjectSettings && issueViews && issueViews.length > 0 && issueViews.map( (_view) => store?.project?.workspaceProjectSettings?.views[_view?.key] && (