import { useState } from "react"; import { observer } from "mobx-react-lite"; import { Search } from "lucide-react"; // hooks import { useApplication, useProjectView } from "hooks/store"; // components import { EmptyState } from "components/empty-state"; import { ViewListLoader } from "components/ui"; import { ProjectViewListItem } from "components/views"; // ui import { Input } from "@plane/ui"; // constants import { EmptyStateType } from "constants/empty-state"; export const ProjectViewsList = observer(() => { // states const [query, setQuery] = useState(""); // store hooks const { commandPalette: { toggleCreateViewModal }, } = useApplication(); const { projectViewIds, getViewById, loader } = useProjectView(); if (loader || !projectViewIds) return ; const viewsList = projectViewIds.map((viewId) => getViewById(viewId)); 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

)}
) : ( toggleCreateViewModal(true)} /> )} ); });