"use client"; import { motion, Variants } from "framer-motion"; import { Globe, Server, Wrench, Shield, Gamepad2, Code, Activity, Lightbulb } from "lucide-react"; import { useEffect, useState } from "react"; import { useLocale, useTranslations } from "next-intl"; import type { JSONContent } from "@tiptap/react"; import RichTextClient from "./RichTextClient"; import CurrentlyReading from "./CurrentlyReading"; const staggerContainer: Variants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.15, delayChildren: 0.2, }, }, }; const fadeInUp: Variants = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0, transition: { duration: 0.5, ease: [0.25, 0.1, 0.25, 1], }, }, }; const About = () => { const locale = useLocale(); const t = useTranslations("home.about"); const [cmsDoc, setCmsDoc] = useState(null); useEffect(() => { (async () => { try { const res = await fetch( `/api/content/page?key=${encodeURIComponent("home-about")}&locale=${encodeURIComponent(locale)}`, ); const data = await res.json(); // Only use CMS content if it exists for the active locale. if (data?.content?.content && data?.content?.locale === locale) { setCmsDoc(data.content.content as JSONContent); } else { setCmsDoc(null); } } catch { // ignore; fallback to static setCmsDoc(null); } })(); }, [locale]); const techStack = [ { category: t("techStack.categories.frontendMobile"), icon: Globe, items: ["Next.js", "Tailwind CSS", "Flutter"], }, { category: t("techStack.categories.backendDevops"), icon: Server, items: ["Docker Swarm", "Traefik", "Nginx Proxy Manager", "Redis"], }, { category: t("techStack.categories.toolsAutomation"), icon: Wrench, items: ["Git", "CI/CD", "n8n", t("techStack.items.selfHostedServices")], }, { category: t("techStack.categories.securityAdmin"), icon: Shield, items: ["CrowdSec", "Suricata", "Mailcow"], }, ]; const hobbies: Array<{ icon: typeof Code; text: string }> = [ { icon: Code, text: t("hobbies.selfHosting") }, { icon: Gamepad2, text: t("hobbies.gaming") }, { icon: Server, text: t("hobbies.gameServers") }, { icon: Activity, text: t("hobbies.jogging") }, ]; return (
{/* Text Content */} {t("title")} {cmsDoc ? ( ) : ( <>

{t("p1")}

{t("p2")}

{t("p3")}

)}

{t("funFactTitle")}

{t("funFactBody")}

{/* Tech Stack & Hobbies */}
{t("techStackTitle")}
{techStack.map((stack, idx) => (

{stack.category}

{stack.items.map((item, itemIdx) => ( {item} ))}
))}
{/* Hobbies */}
{t("hobbiesTitle")}
{hobbies.map((hobby, idx) => ( {hobby.text} ))}
{/* Currently Reading */}
); }; export default About;