// components/ProjectContentTemplate.tsx import React from 'react'; import { useTranslation } from 'react-i18next'; import { Calendar, Building2, Clock, Tag } from 'lucide-react'; interface Section { title: string; description?: string; content?: string; points?: string[]; code?: string; image?: string; } interface ProjectTranslation { meta: { title: string; description: string; date: string; client: string; duration: string; technologies: string[]; }; content: { intro: string; challenge: Section; solution: Section; technical: Section; implementation: Section; results: Section; conclusion: string; }; } interface ProjectContentTemplateProps { translationKey: string; fallbackData?: ProjectTranslation; } const ProjectContentTemplate: React.FC = ({ translationKey, fallbackData }) => { // Nur 't' aus dem Hook extrahieren, da 'i18n' nicht verwendet wird const { t } = useTranslation(); // Übersetzten Inhalt abrufen const translatedContent = t(`${translationKey}`, { returnObjects: true, defaultValue: fallbackData }) as ProjectTranslation; const renderSection = (section: Section) => { if (!section) return null; return (

{section.title}

{section.description && (

{section.description}

)} {section.content && (
{section.content}
)} {section.points && ( )} {section.code && (
            
              {section.code}
            
          
)} {section.image && (
{section.title}
)}
); }; return (
{/* Project Meta Information */}
{translatedContent.meta.client}
{translatedContent.meta.duration}

{translatedContent.meta.title}

{translatedContent.meta.description}

{/* Introduction */}

{translatedContent.content.intro}

{/* Main Sections */} {renderSection(translatedContent.content.challenge)} {renderSection(translatedContent.content.solution)} {renderSection(translatedContent.content.technical)} {renderSection(translatedContent.content.implementation)} {renderSection(translatedContent.content.results)} {/* Conclusion */} {translatedContent.content.conclusion && (

{t('portfolio.sections.conclusion')}

{translatedContent.content.conclusion}

)} {/* Technologies */}
{translatedContent.meta.technologies.map((tech) => ( {t(`technologies.${tech}`, tech)} ))}
); }; export default ProjectContentTemplate;