import { observer } from "mobx-react-lite"; // hooks import { useApplication, useEventTracker, useProject } from "hooks/store"; // components import { EmptyState } from "components/empty-state"; import { ProjectCard } from "components/project"; import { ProjectsLoader } from "components/ui"; // constants import { EmptyStateType } from "constants/empty-state"; export const ProjectCardList = observer(() => { // store hooks const { commandPalette: commandPaletteStore } = useApplication(); const { setTrackElement } = useEventTracker(); const { workspaceProjectIds, searchedProjects, getProjectById } = useProject(); if (!workspaceProjectIds) return ; return ( <> {workspaceProjectIds.length > 0 ? (
{searchedProjects.length == 0 ? (
No matching projects
) : (
{searchedProjects.map((projectId) => { const projectDetails = getProjectById(projectId); if (!projectDetails) return; return ; })}
)}
) : ( { setTrackElement("Project empty state"); commandPaletteStore.toggleCreateProjectModal(true); }} /> )} ); });