"use client"; import { useState, useEffect } from "react"; import { Globe, Server, Wrench, Shield, Gamepad2, Code, Activity, Lightbulb, BookOpen, MessageSquare, ArrowUpRight, Book } from "lucide-react"; import { useLocale, useTranslations } from "next-intl"; import type { JSONContent } from "@tiptap/react"; import RichTextClient from "./RichTextClient"; import CurrentlyReading from "./CurrentlyReading"; import { motion } from "framer-motion"; import { TechStackCategory, Hobby, BookReview } from "@/lib/directus"; import Link from "next/link"; import ActivityFeed from "./ActivityFeed"; import BentoChat from "./BentoChat"; const iconMap: Record = { Globe, Server, Code, Wrench, Shield, Activity, Lightbulb, Gamepad2 }; const About = () => { const locale = useLocale(); const t = useTranslations("home.about"); const [cmsDoc, setCmsDoc] = useState(null); const [techStack, setTechStack] = useState([]); const [hobbies, setHobbies] = useState([]); const [reviewsCount, setReviewsCount] = useState(0); const [cmsMessages, setCmsMessages] = useState>({}); useEffect(() => { const fetchData = async () => { try { const [cmsRes, techRes, hobbiesRes, msgRes, booksRes] = 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/book-reviews?locale=${locale}`) ]); 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 booksData = await booksRes.json(); if (booksData?.bookReviews) setReviewsCount(booksData.bookReviews.length); } catch (error) {} }; fetchData(); }, [locale]); return (
{/* 1. Bio Box */}

{t("title")}.

{cmsDoc ? :

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

}

{t("funFactTitle")}

{t("funFactBody")}

{/* 2. Status Box (Currently) */}

Status

{/* 3. AI Chat Box */}

AI Assistant

{/* 4. Tech Stack */}
{techStack.map((cat) => (

{cat.name}

{cat.items?.map((item: any) => ( {item.name} ))}
))}
{/* 5. Library (Visual Teaser) */}

Library

ARCHIVE OF KNOWLEDGE

{reviewsCount}+ Books

Read and summarized in my personal collection.

{/* 6. Hobbies (Clean Editorial Look) */}

Beyond Dev

{hobbies.map((hobby) => { const Icon = iconMap[hobby.icon] || Lightbulb; return (

{hobby.title}

Passion & Mindset

) })}
); }; export default About;