import { Boxes, ExternalLink, Filter, FolderKanban, Layers3, Plus, Tags } from "lucide-react"; import Link from "next/link"; import { MotionFade } from "@/components/motion-fade"; import { PortfolioSubnav } from "@/components/root/portfolio-subnav"; import { AppCard } from "@/components/ui/app-card"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { getLocalizedPath } from "@/lib/locale"; import { getLocalizedValue, type PortfolioCategoryView, type PortfolioProjectView } from "@/lib/portfolio"; type PortfolioProjectsOverviewProps = { categories: PortfolioCategoryView[]; projects: PortfolioProjectView[]; selectedCategory: string; selectedStatus: "all" | "draft" | "published"; }; const copy = { summary: "Portfolio cockpit", description: "Alle Projekte, Filter und Einstiegspunkte fuer die Bearbeitung an einem Ort.", totalCategories: "Kategorien", totalProjects: "Projekte", publishedProjects: "Veroeffentlicht", newProject: "Neues Projekt", newCategory: "Neue Kategorie", category: "Kategorie", all: "Alle", status: "Status", draft: "Entwurf", published: "Veroeffentlicht", filter: "Filter anwenden", empty: "Noch keine Projekte vorhanden. Lege das erste Projekt an und beginne direkt mit Inhalt, Abschnitten und Dateien.", openProject: "Projekt ansehen", editProject: "Projekt bearbeiten", review: "Bearbeitungsstand", reviewDone: "Bereit", reviewMissing: "Fehlt etwas", untitled: "Unbenanntes Projekt", noCategory: "Ohne Kategorie", noPreview: "Kein Preview Link", hasPreview: "Preview Link vorhanden", hasCover: "Cover gesetzt", missingCover: "Cover fehlt", hasSections: "Abschnitte vorhanden", noSections: "Keine Abschnitte", hasAssets: "Dateien vorhanden", noAssets: "Keine Dateien", }; function getProjectCompletion(project: PortfolioProjectView) { const completedChecks = [ Boolean(project.slug.trim()), Boolean(project.coverImagePath), project.sections.length > 0, project.assets.length > 0, Boolean(project.title.ar.trim() && project.title.en.trim() && project.title.de.trim()), Boolean(project.summary.ar.trim() && project.summary.en.trim() && project.summary.de.trim()), ].filter(Boolean).length; return { completedChecks, totalChecks: 6, ready: completedChecks === 6, }; } export function PortfolioProjectsOverview({ categories, projects, selectedCategory, selectedStatus, }: PortfolioProjectsOverviewProps) { const publishedProjects = projects.filter((project) => project.isPublished).length; return (
{copy.summary}
{copy.description}
{item.label}
{item.value}
{getLocalizedValue(project.summary, "de") || "Noch keine Kurzbeschreibung hinterlegt."}
{copy.empty}