"use client"; import { motion } from "framer-motion"; import { useLocale, useTranslations } from "next-intl"; import Image from "next/image"; import { useEffect, useState } from "react"; const Hero = () => { const locale = useLocale(); const t = useTranslations("home.hero"); const [cmsMessages, setCmsMessages] = useState>({}); useEffect(() => { (async () => { try { const res = await fetch(`/api/messages?locale=${locale}`); if (res.ok) { const data = await res.json(); setCmsMessages(data.messages || {}); } } catch {} })(); }, [locale]); // Helper to get CMS text or fallback const getLabel = (key: string, fallback: string) => cmsMessages[key] || fallback; return (
{/* Liquid Ambient Background */}
{/* Left: Text Content */}
{getLabel("hero.badge", "Student & Self-Hoster")}

{getLabel("hero.line1", "Building")} {getLabel("hero.line2", "Stuff.")}

{t("description")} {/* Right: The Photo */}
Dennis Konkol
dk0.dev
); }; export default Hero;