/* eslint-disable @next/next/no-img-element */ import { CheckCircle2, ExternalLink, FolderKanban, ImageOff, Plus, Star, Tags } from "lucide-react"; import Link from "next/link"; import { StatsCard } from "@/components/dashboard/stats-card"; import { PortfolioProjectActions } from "@/components/admin/portfolio-project-actions"; import { AppCard } from "@/components/ui/app-card"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card } from "@/components/ui/card"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { getAdminAppPath } from "@/lib/admin-routing"; import { getSiteSettings } from "@/lib/app-config"; 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 = { all: "Alle", newProject: "Neues Projekt", newCategory: "Neues Kategorie", view: "Auf der Website ansehen", untitled: "Unbenanntes Projekt", empty: "Noch keine Projekte vorhanden.", emptyFiltered: "Keine Projekte in dieser Auswahl.", emptyHint: "Lege dein erstes Projekt an, um es hier zu verwalten.", colProject: "Projekt", colCategory: "Kategorie", colYear: "Jahr", colStatus: "Status", colMode: "Layout", colActions: "Aktionen", published: "Published", draft: "Draft", featured: "Featured", }; function categoryLabel(name: PortfolioCategoryView["name"]) { return name.de || name.en || name.ar; } export async function PortfolioProjectsOverview({ categories, projects, selectedCategory, }: PortfolioProjectsOverviewProps) { const siteSettings = await getSiteSettings(); const publishedCount = projects.filter((project) => project.isPublished).length; const isFiltered = selectedCategory !== ""; return (
{categories.map((category) => ( ))}
{projects.length === 0 ? (

{isFiltered ? copy.emptyFiltered : copy.empty}

{copy.emptyHint}

{isFiltered ? ( ) : ( )}
) : ( Cover {copy.colProject} {copy.colCategory} {copy.colYear} {copy.colStatus} {copy.colMode} {copy.colActions} {projects.map((project) => { const title = getLocalizedValue(project.title, "de") || copy.untitled; return (
{project.coverImagePath ? ( {title} ) : ( )}
{title} {project.isFeatured ? ( ) : null} /{project.slug}
{categoryLabel(project.category.name)} {project.projectYear} {project.isPublished ? copy.published : copy.draft} {project.viewMode}
); })}
)}
); }