"use client"; import { FC } from "react"; import { observer } from "mobx-react-lite"; // constants import { issueViews } from "@/constants/data"; // hooks import { useProject } from "@/hooks/store"; // mobx import { TIssueBoardKeys } from "@/types/issue"; type NavbarIssueBoardViewProps = { layouts: Record; }; export const NavbarIssueBoardView: FC = observer((props) => { const { layouts } = props; const { activeLayout, setActiveLayout } = useProject(); const handleCurrentBoardView = (boardView: string) => { setActiveLayout(boardView as TIssueBoardKeys); }; return ( <> {layouts && Object.keys(layouts).map((layoutKey: string) => { if (layouts[layoutKey as TIssueBoardKeys]) { return (
handleCurrentBoardView(layoutKey)} title={layoutKey} > {issueViews[layoutKey]?.icon}
); } })} ); });