/** * RecentProjects Component * * Displays recent projects in a responsive grid with a "View all" link. * Shows 3 projects on mobile, 6 on desktop. * * @see Issue #53 */ 'use client'; import { ArrowRight, Bot, CircleDot, Clock } from 'lucide-react'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { Skeleton } from '@/components/ui/skeleton'; import { Link } from '@/lib/i18n/routing'; import { cn } from '@/lib/utils'; import { ProjectStatusBadge } from '@/components/projects/StatusBadge'; import { ProgressBar } from '@/components/projects/ProgressBar'; import type { DashboardProject } from '@/lib/api/hooks/useDashboard'; export interface RecentProjectsProps { /** Projects to display */ projects?: DashboardProject[]; /** Whether data is loading */ isLoading?: boolean; /** Additional CSS classes */ className?: string; } function ProjectCardSkeleton() { return (
); } interface ProjectCardProps { project: DashboardProject; } function ProjectCard({ project }: ProjectCardProps) { return (
{project.currentSprint && ( {project.currentSprint} )}
{project.name}
{project.description && (

{project.description}

)}
{project.activeAgents} agents {project.openIssues} issues
{project.lastActivity}
); } export function RecentProjects({ projects, isLoading = false, className }: RecentProjectsProps) { // Show first 3 on mobile (hidden beyond), 6 on desktop const displayProjects = projects?.slice(0, 6) ?? []; return (

Recent Projects

{isLoading ? (
{[1, 2, 3, 4, 5, 6].map((i) => (
3 && 'hidden lg:block')} >
))}
) : displayProjects.length === 0 ? (

No projects yet

) : (
{displayProjects.map((project, index) => (
= 3 && 'hidden lg:block')} >
))}
)}
); }