import { useState } from "react"; import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; // components import { ProjectViewListItem } from "components/views"; import { EmptyState } from "components/common"; // ui import { Input, Loader } from "@plane/ui"; // assets import emptyView from "public/empty-state/view.svg"; // icons import { Plus, Search } from "lucide-react"; export const ProjectViewsList = observer(() => { const [query, setQuery] = useState(""); const router = useRouter(); const { projectId } = router.query; const { projectViews: projectViewsStore } = useMobxStore(); const viewsList = projectId ? projectViewsStore.viewsList[projectId.toString()] : undefined; if (!viewsList) return ( ); const filteredViewsList = viewsList.filter((v) => v.name.toLowerCase().includes(query.toLowerCase())); return ( <> {viewsList.length > 0 ? (
setQuery(e.target.value)} placeholder="Search" mode="true-transparent" />
{filteredViewsList.length > 0 ? ( filteredViewsList.map((view) => ) ) : (

No results found

)}
) : ( , text: "New View", onClick: () => { const e = new KeyboardEvent("keydown", { key: "v", }); document.dispatchEvent(e); }, }} /> )} ); });