import { observer } from "mobx-react-lite"; import Image from "next/image"; // hooks // components import { EmptyState } from "@/components/empty-state"; import { ProjectCard } from "@/components/project"; import { ProjectsLoader } from "@/components/ui"; // assets import { EmptyStateType } from "@/constants/empty-state"; import { useApplication, useEventTracker, useProject, useProjectFilter } from "@/hooks/store"; import AllFiltersImage from "public/empty-state/project/all-filters.svg"; import NameFilterImage from "public/empty-state/project/name-filter.svg"; // constants export const ProjectCardList = observer(() => { // store hooks const { commandPalette: commandPaletteStore } = useApplication(); const { setTrackElement } = useEventTracker(); const { workspaceProjectIds, filteredProjectIds, getProjectById } = useProject(); const { searchQuery, currentWorkspaceDisplayFilters } = useProjectFilter(); if (workspaceProjectIds?.length === 0 && !currentWorkspaceDisplayFilters?.archived_projects) return ( { setTrackElement("Project empty state"); commandPaletteStore.toggleCreateProjectModal(true); }} /> ); if (!filteredProjectIds) return ; if (filteredProjectIds.length === 0) return (
No matching projects
No matching projects

{searchQuery.trim() === "" ? "Remove the filters to see all projects" : "No projects detected with the matching\ncriteria. Create a new project instead"}

); return (
{filteredProjectIds.map((projectId) => { const projectDetails = getProjectById(projectId); if (!projectDetails) return; return ; })}
); });