"use client"; import Link from "next/link"; import { motion } from "framer-motion"; import { ArrowRight, Video, Image, Music, Sparkles, Zap, Shield, Users, Check, } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { useTranslation, getServerTranslations } from "@/lib/i18n"; import { useState, useEffect } from "react"; function useFeatures() { const [mounted, setMounted] = useState(false); useEffect(() => setMounted(true), []); const { t } = useTranslation(); const getT = (key: string) => { if (!mounted) return getServerTranslations("en").t(key); return t(key); }; return [ { icon: Video, title: getT("home.tools.videoToFrames.title"), description: getT("home.tools.videoToFrames.description"), href: "/tools/video-frames", }, { icon: Image, title: getT("home.tools.imageCompression.title"), description: getT("home.tools.imageCompression.description"), href: "/tools/image-compress", }, { icon: Music, title: getT("home.tools.audioCompression.title"), description: getT("home.tools.audioCompression.description"), href: "/tools/audio-compress", }, { icon: Sparkles, title: getT("home.tools.aiTools.title"), description: getT("home.tools.aiTools.description"), href: "/tools/ai-tools", }, ]; } function useBenefits() { const [mounted, setMounted] = useState(false); useEffect(() => setMounted(true), []); const { t } = useTranslation(); const getT = (key: string) => { if (!mounted) return getServerTranslations("en").t(key); return t(key); }; return [ { icon: Zap, title: getT("home.benefits.lightningFast.title"), description: getT("home.benefits.lightningFast.description"), }, { icon: Shield, title: getT("home.benefits.secure.title"), description: getT("home.benefits.secure.description"), }, { icon: Users, title: getT("home.benefits.forDevelopers.title"), description: getT("home.benefits.forDevelopers.description"), }, ]; } function usePricingPlans() { const [mounted, setMounted] = useState(false); useEffect(() => setMounted(true), []); const { t } = useTranslation(); const getT = (key: string) => { if (!mounted) return getServerTranslations("en").t(key); return t(key); }; return [ { name: getT("home.pricing.plans.free.name"), price: getT("home.pricing.plans.free.price"), description: getT("home.pricing.plans.free.description"), features: (mounted ? t("home.pricing.plans.free.features") : getServerTranslations("en").t("home.pricing.plans.free.features")) as unknown as string[], cta: getT("home.pricing.plans.free.cta"), href: "/register", }, { name: getT("home.pricing.plans.pro.name"), price: getT("home.pricing.plans.pro.price"), period: getT("home.pricing.plans.pro.period"), description: getT("home.pricing.plans.pro.description"), features: (mounted ? t("home.pricing.plans.pro.features") : getServerTranslations("en").t("home.pricing.plans.pro.features")) as unknown as string[], cta: getT("home.pricing.plans.pro.cta"), href: "/pricing", popular: getT("home.pricing.plans.pro.popular"), }, { name: getT("home.pricing.plans.enterprise.name"), price: getT("home.pricing.plans.enterprise.price"), description: getT("home.pricing.plans.enterprise.description"), features: (mounted ? t("home.pricing.plans.enterprise.features") : getServerTranslations("en").t("home.pricing.plans.enterprise.features")) as unknown as string[], cta: getT("home.pricing.plans.enterprise.cta"), href: "/contact", }, ]; } function HeroSection() { const [mounted, setMounted] = useState(false); useEffect(() => setMounted(true), []); const { t } = useTranslation(); const getT = (key: string, params?: any) => { if (!mounted) return getServerTranslations("en").t(key, params); return t(key, params); }; return (
{/* Background gradient */}
{getT("home.hero.badge")}

{getT("home.hero.title")}

{getT("home.hero.description")}

{/* Stats */}
10K+
{getT("home.hero.stats.developers")}
1M+
{getT("home.hero.stats.filesProcessed")}
99.9%
{getT("home.hero.stats.uptime")}
); } function FeaturesSection() { const [mounted, setMounted] = useState(false); useEffect(() => setMounted(true), []); const { t } = useTranslation(); const features = useFeatures(); const getT = (key: string) => { if (!mounted) return getServerTranslations("en").t(key); return t(key); }; return (

{getT("home.featuresSection.title")}

{getT("home.featuresSection.description")}

{features.map((feature, index) => (
{feature.title} {feature.description}
))}
); } function BenefitsSection() { const [mounted, setMounted] = useState(false); useEffect(() => setMounted(true), []); const { t } = useTranslation(); const benefits = useBenefits(); const getT = (key: string) => { if (!mounted) return getServerTranslations("en").t(key); return t(key); }; return (

{getT("home.benefits.title")}

{getT("home.benefits.description")}

{benefits.map((benefit, index) => (

{benefit.title}

{benefit.description}

))}
); } function PricingSection() { const [mounted, setMounted] = useState(false); useEffect(() => setMounted(true), []); const { t } = useTranslation(); const pricingPlans = usePricingPlans(); const getT = (key: string) => { if (!mounted) return getServerTranslations("en").t(key); return t(key); }; return (

{getT("home.pricing.title")}

{getT("home.pricing.description")}

{pricingPlans.map((plan, index) => ( {plan.popular && ( {plan.popular} )} {plan.name} {plan.description}
{plan.price} {plan.period && ( {plan.period} )}
    {plan.features.map((feature) => (
  • {feature}
  • ))}
))}
); } function CTASection() { const [mounted, setMounted] = useState(false); useEffect(() => setMounted(true), []); const { t } = useTranslation(); const getT = (key: string) => { if (!mounted) return getServerTranslations("en").t(key); return t(key); }; return (

{getT("home.cta.title")}

{getT("home.cta.description")}

); } export default function HomePage() { return ( <> ); }