import { observer } from "mobx-react-lite"; // components import { ListLayout } from "@/components/core/list"; import { EmptyState } from "@/components/empty-state"; import { ViewListLoader } from "@/components/ui"; import { ProjectViewListItem } from "@/components/views"; // constants import { EmptyStateType } from "@/constants/empty-state"; // hooks import { useCommandPalette, useProjectView } from "@/hooks/store"; export const ProjectViewsList = observer(() => { // store hooks const { toggleCreateViewModal } = useCommandPalette(); const { projectViewIds, getViewById, loader, searchQuery } = useProjectView(); if (loader || !projectViewIds) return ; // derived values const viewsList = projectViewIds.map((viewId) => getViewById(viewId)); const filteredViewsList = viewsList.filter((v) => v?.name.toLowerCase().includes(searchQuery.toLowerCase())); return ( <> {viewsList.length > 0 ? (
{filteredViewsList.length > 0 ? ( filteredViewsList.map((view) => ) ) : (

No results found

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