"use client"; import { useState } from "react"; import { motion } from "framer-motion"; import Image from "next/image"; import { ShoppingCart, Calendar, Server, Smartphone, BarChart3, Building, } from "lucide-react"; import GlassCard from "@/components/ui/GlassCard"; import ProjectModal from "@/components/ui/ProjectModal"; import { LiveDot, InProgressBadge, ProjectLinks } from "@/components/sections/ProjectsCarousel"; import { fadeUp, stagger, viewportConfig } from "@/lib/animations"; import type { Dictionary, Locale } from "@/lib/dictionaries"; const projectIcons: Record = { "client-ecommerce": ShoppingCart, "booking-platform": Calendar, "infra-dashboard": Server, "mobile-companion": Smartphone, "analytics-service": BarChart3, "business-landing": Building, "etf-oglasi": Smartphone, }; const projectColors: Record = { "client-ecommerce": "from-blue-500/20 to-blue-600/5 text-blue-300", "booking-platform": "from-emerald-500/20 to-emerald-600/5 text-emerald-300", "infra-dashboard": "from-purple-500/20 to-purple-600/5 text-purple-300", "mobile-companion": "from-rose-500/20 to-rose-600/5 text-rose-300", "analytics-service": "from-amber-500/20 to-amber-600/5 text-amber-300", "business-landing": "from-slate-400/20 to-slate-500/5 text-slate-300", "etf-oglasi": "from-violet-500/20 to-violet-600/5 text-violet-300", }; interface ProjectsShowcaseProps { locale: Locale; dict: Dictionary; filter?: "client" | "personal"; sectionTitle?: string; } export default function ProjectsShowcase({ dict, filter, sectionTitle, }: ProjectsShowcaseProps) { let projects = [...dict.projects.items]; if (filter) projects = projects.filter((p) => p.type === filter); projects.sort((a, b) => a.order - b.order); type Project = (typeof projects)[number]; const [selectedProject, setSelectedProject] = useState(null); if (projects.length === 0) return null; return (
{sectionTitle && ( {sectionTitle} )} {projects.map((project) => { const Icon = projectIcons[project.slug] || Building; const colorClass = projectColors[project.slug] || "from-purple-500/20 to-purple-600/5 text-purple-300"; const gradientClasses = colorClass.split(" ").slice(0, 2).join(" "); const iconColor = colorClass.split(" ").slice(2).join(" "); const previewImage = project.screenshots[0]; return ( setSelectedProject(project)} > {previewImage ? (
{project.title}
) : (
)}
{project.type === "client" ? dict.projects.clientWork : dict.projects.personal} {project.live && } {project.inProgress && }

{project.title}

{project.description}

{project.tags.map((tag) => ( {tag} ))}
e.stopPropagation()} className="mt-auto">
); })}
setSelectedProject(null)} />
); }