'use client'; import { useTranslations } from 'next-intl'; import { useParams } from 'next/navigation'; import { FaArrowLeft, FaGithub, FaExternalLinkAlt } from 'react-icons/fa'; import Link from 'next/link'; import Image from 'next/image'; const projectsData = [ { id: 1, tech: ["Next.js", "React", "TypeScript", "Tailwind CSS", "Node.js", "Express"], imageUrl: "/Portfolio.png", repoUrl: "https://github.com/joaonloureiro/portfolio-app", liveUrl: "https://joaoloureiro.dev.br" }, { id: 2, tech: ["Docker", "Proxmox", "Traefik", "Gitea", "MariaDB", "RabbitMQ", "Prometheus", "Grafana", "N8N"], imageUrl: "/ProxmoxServer.png", }, { id: 3, tech: ["React", "TypeScript", "Styled-Components", "Node.js", "Express", "MariaDB"], imageUrl: "/Happy.png", repoUrl: "https://github.com/joaonloureiro/happy-app", liveUrl: "https://happy.joaoloureiro.dev.br/" } ]; export default function ProjectPage() { const t = useTranslations('projects'); const { id } = useParams(); const projectId = parseInt(id as string, 10); const project = projectsData.find(p => p.id === projectId); if (!project) { return (

Project Not Found

{t('back_to_projects')}
); } // Helper function to safely get the features array from translations const getProjectFeatures = (id: number): string[] => { try { const features = t.raw(`project_${id}_features`); return Array.isArray(features) ? features : []; } catch { return []; } }; const projectFeatures = getProjectFeatures(project.id); return (
{t('back_to_projects')}
{t(`project_${project.id}_title`)}

{t(`project_${project.id}_title`)}

{t('about_project')}

{t(`project_${project.id}_details`)}

{t(`project_${project.id}_features_title`)}

    {projectFeatures.map((feature, index) => (
  • $1') }} /> ))}
); }