/** * ProjectsGrid Component * * Displays projects in either grid or list view with * loading and empty states. * * @see Issue #54 */ 'use client'; import { Folder, Plus } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Link } from '@/lib/i18n/routing'; import { cn } from '@/lib/utils'; import { ProjectCard, ProjectCardSkeleton } from './ProjectCard'; import type { ProjectListItem } from '@/lib/api/hooks/useProjects'; import type { ViewMode } from './ProjectFilters'; export interface ProjectsGridProps { /** Projects to display */ projects: ProjectListItem[]; /** Whether data is loading */ isLoading?: boolean; /** Current view mode */ viewMode?: ViewMode; /** Called when a project card is clicked */ onProjectClick?: (project: ProjectListItem) => void; /** Called when a project action is selected */ onProjectAction?: ( project: ProjectListItem, action: 'archive' | 'pause' | 'resume' | 'delete' ) => void; /** Whether filters are currently applied (affects empty state message) */ hasFilters?: boolean; /** Additional CSS classes */ className?: string; } /** * Empty state component */ function EmptyState({ hasFilters }: { hasFilters: boolean }) { return (
{hasFilters ? 'Try adjusting your filters or search query' : 'Get started by creating your first project'}
{!hasFilters && ( )}