import React from 'react'; export default function ProjectCard({ project, onSelect }) { const { title, description, category, status, tech_stack, github_url, demo_url, image_url } = project; // Format status class name const getStatusClass = (statusStr) => { if (!statusStr) return ''; const s = statusStr.toLowerCase(); if (s.includes('active') || s.includes('phát triển')) return 'active-development'; return 'completed'; }; // Split tech stack string into array const techTags = tech_stack ? tech_stack.split(',').map(tag => tag.trim()) : []; return (
{title} { e.target.onerror = null; e.target.src = 'https://images.unsplash.com/photo-1555066931-4365d14bab8c?auto=format&fit=crop&w=600&q=80'; }} />
{category} {status}

{title}

{description.length > 120 ? `${description.substring(0, 120)}...` : description}

{techTags.map((tech, index) => ( {tech} ))}
{github_url && ( GitHub )} {demo_url && ( Live Demo )}
); }