import React from 'react'; import { Link } from 'react-router-dom'; import { motion } from 'framer-motion'; import { ExternalLink, Calendar, Tag } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { trackProjectClick } from '../../../services/gtm'; interface Project { id: string; title: string; description: string; tags: string[]; slug: string; date?: string; excerpt?: string; technologies?: string[]; category?: string; } interface PortfolioCardProps { project: Project; } const PortfolioCard: React.FC = ({ project }) => { const { t } = useTranslation(); const itemVariants = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0 } }; const basePath = `/images/projects/${project.slug}`; const imagePath = `${basePath}/cover.jpg`; const srcSetJpg = `${basePath}/cover-200w.jpg 200w, ${basePath}/cover-300w.jpg 300w, ${basePath}/cover-400w.jpg 400w, ${basePath}/cover-600w.jpg 600w, ${basePath}/cover-800w.jpg 800w, ${basePath}/cover-1200w.jpg 1200w`; const srcSetWebP = `${basePath}/cover-200w.webp 200w, ${basePath}/cover-300w.webp 300w, ${basePath}/cover-400w.webp 400w, ${basePath}/cover-600w.webp 600w, ${basePath}/cover-800w.webp 800w, ${basePath}/cover-1200w.webp 1200w`; // Mobile: ~350px, Tablet: ~400px, Desktop 2-col: ~550px, Desktop 3-col: ~400px const imageSizes = "(max-width: 640px) 350px, (max-width: 768px) 400px, (max-width: 1024px) 550px, 400px"; // Verwende technologies anstelle von tags wenn verfügbar const displayTags = project.technologies || project.tags; const handleClick = () => { trackProjectClick(project.title, project.category); }; return ( {/* Image Container */}
{project.title}
{/* Content - with relative positioning to overlap the gradient */}
{/* Project Info */}
{project.date && (
{project.date}
)} {displayTags && displayTags.length > 0 && (
{t('portfolio.ui.technologiesCount', { count: displayTags.length, defaultValue: '{{count}} Technologies' })}
)}
{/* Title & Description */}

{project.title}

{project.excerpt || project.description}

{/* Tags */}
{displayTags.slice(0, 3).map((tag, index) => ( {tag} ))} {displayTags.length > 3 && ( {t('portfolio.ui.moreTechnologies', { count: displayTags.length - 3, defaultValue: '+{{count}} more' })} )}
{/* Link Icon */}
{/* Subtle Hover Border */}
); }; export default PortfolioCard;