import React, { useState } from "react"; import { useRouter } from "next/router"; import useSWR from "swr"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // components import { GlobalDefaultViewListItem, GlobalViewsList } from "components/workspace"; import { GlobalIssuesHeader } from "components/headers"; // ui import { Input } from "components/ui"; // icons import { MagnifyingGlassIcon } from "@heroicons/react/24/outline"; // types import type { NextPage } from "next"; // constants import { DEFAULT_GLOBAL_VIEWS_LIST } from "constants/workspace"; // fetch-keys import { GLOBAL_VIEWS_LIST } from "constants/fetch-keys"; const WorkspaceViews: NextPage = () => { const [query, setQuery] = useState(""); const router = useRouter(); const { workspaceSlug } = router.query; const { globalViews: globalViewsStore } = useMobxStore(); useSWR( workspaceSlug ? GLOBAL_VIEWS_LIST(workspaceSlug.toString()) : null, workspaceSlug ? () => globalViewsStore.fetchAllGlobalViews(workspaceSlug.toString()) : null ); return ( Workspace Views } right={} >
setQuery(e.target.value)} placeholder="Search" mode="trueTransparent" />
{DEFAULT_GLOBAL_VIEWS_LIST.filter((v) => v.label.toLowerCase().includes(query.toLowerCase())).map((option) => ( ))}
); }; export default WorkspaceViews;