"use client"; import { useState, useEffect } from "react"; import { Globe, Server, Wrench, Shield, Gamepad2, Code, Activity, Lightbulb, BookOpen, MessageSquare, ArrowRight, Tv, Plane, Camera, Stars, Music, Terminal, Cpu } from "lucide-react"; import { useLocale, useTranslations } from "next-intl"; import type { JSONContent } from "@tiptap/react"; import dynamic from "next/dynamic"; const RichTextClient = dynamic(() => import("./RichTextClient"), { ssr: false }); import CurrentlyReading from "./CurrentlyReading"; import ReadBooks from "./ReadBooks"; import { motion, AnimatePresence } from "framer-motion"; import { TechStackCategory, TechStackItem, Hobby, Snippet } from "@/lib/directus"; import Link from "next/link"; import ActivityFeed from "./ActivityFeed"; import BentoChat from "./BentoChat"; import { Skeleton } from "./ui/Skeleton"; import { LucideIcon, X, Copy, Check } from "lucide-react"; const iconMap: Record = { Globe, Server, Code, Wrench, Shield, Activity, Lightbulb, Gamepad2, BookOpen, Tv, Plane, Camera, Stars, Music, Terminal, Cpu }; const About = () => { const locale = useLocale(); const t = useTranslations("home.about"); const [cmsDoc, setCmsDoc] = useState(null); const [techStack, setTechStack] = useState([]); const [hobbies, setHobbies] = useState([]); const [snippets, setSnippets] = useState([]); const [selectedSnippet, setSelectedSnippet] = useState(null); const [copied, setCopied] = useState(false); const [_cmsMessages, setCmsMessages] = useState>({}); const [isLoading, setIsLoading] = useState(true); useEffect(() => { const fetchData = async () => { try { const [cmsRes, techRes, hobbiesRes, msgRes, snippetsRes] = await Promise.all([ fetch(`/api/content/page?key=home-about&locale=${locale}`), fetch(`/api/tech-stack?locale=${locale}`), fetch(`/api/hobbies?locale=${locale}`), fetch(`/api/messages?locale=${locale}`), fetch(`/api/snippets?limit=3&featured=true`) ]); const cmsData = await cmsRes.json(); if (cmsData?.content?.content) setCmsDoc(cmsData.content.content as JSONContent); const techData = await techRes.json(); if (techData?.techStack) setTechStack(techData.techStack); const hobbiesData = await hobbiesRes.json(); if (hobbiesData?.hobbies) setHobbies(hobbiesData.hobbies); const msgData = await msgRes.json(); if (msgData?.messages) setCmsMessages(msgData.messages); const snippetsData = await snippetsRes.json(); if (snippetsData?.snippets) setSnippets(snippetsData.snippets); } catch (error) { console.error("About data fetch failed:", error); } finally { setIsLoading(false); } }; fetchData(); }, [locale]); const copyToClipboard = (code: string) => { navigator.clipboard.writeText(code); setCopied(true); setTimeout(() => setCopied(false), 2000); }; return (
{/* 1. Large Bio Text */}

{t("title")}.

{isLoading ? (
) : cmsDoc ? ( ) : (

{t("p1")} {t("p2")}

)}

{t("funFactTitle")}

{isLoading ? :

{t("funFactBody")}

}
{/* 2. Activity / Status Box */}

Status

{/* 3. AI Chat Box */}

AI Assistant

{/* 4. Tech Stack */}
{isLoading ? ( Array.from({ length: 4 }).map((_, i) => (
)) ) : ( techStack.map((cat) => (

{cat.name}

{cat.items?.map((item: TechStackItem) => ( {item.name} ))}
)) )}
{/* 5. Library, Gear & Snippets */}
{/* Library - Larger Span */}

Library

View All
{/* My Gear (Uses) */}

My Gear

Main

MacBook M4 Pro

PC

RTX 3080 / R7

Server

IONOS & RPi 4

OS

macOS / Linux

Snippets

{isLoading ? ( Array.from({ length: 2 }).map((_, i) => ) ) : snippets.length > 0 ? ( snippets.map((s) => ( )) ) : (

No snippets yet.

)}
Enter the Lab
{/* 6. Hobbies */}
{isLoading ? ( Array.from({ length: 8 }).map((_, i) => ) ) : ( hobbies.map((hobby) => { const Icon = iconMap[hobby.icon] || Lightbulb; return (

{hobby.title}

{hobby.description}

) }) )}

{t("hobbiesTitle")}

{locale === 'de' ? 'Neugier über die Softwareentwicklung hinaus.' : 'Curiosity beyond software engineering.'}

{/* Snippet Modal */} {selectedSnippet && (
setSelectedSnippet(null)} className="absolute inset-0 bg-stone-950/60 backdrop-blur-md" />

{selectedSnippet.category}

{selectedSnippet.title}

{selectedSnippet.description}

                    {selectedSnippet.code}
                  
)}
); }; export default About;