'use client'; import React, { useState, useEffect, useRef } from 'react'; import Link from 'next/link'; import dynamic from 'next/dynamic'; const Hero3DCanvas = dynamic( () => import('@/components/3d/HeroCrystalCanvas').then((mod) => mod.HeroCrystalCanvas), { ssr: false, loading: () => null } ); import { Sparkles, ArrowRight, Smartphone, ArrowDown, ShieldCheck, LockKeyhole, Check, Zap, SlidersHorizontal, UploadCloud, QrCode } from 'lucide-react'; import { ToolItem, VariantSpec, resolveLocalised } from '@/types'; import { TextAnimate } from '@/components/magicui/text-animate'; import { Particles } from '@/components/magicui/particles'; import { TryItWidget } from './TryItWidget'; import { GrainTransformShowcase } from '@/components/ui/GrainTransformShowcase'; interface HeroSectionProps { title?: Record | string; badge?: Record | string; subtitle?: Record | string; primaryCta?: { label?: Record | string; href?: string }; secondaryCta?: { label?: Record | string; href?: string }; variant?: string; tool?: ToolItem; homeApp?: any; variants?: VariantSpec[]; locale?: string; } export function HeroSection({ title, badge, subtitle, primaryCta, secondaryCta, variant = 'frontpage', tool, homeApp, variants = [], locale = 'en', }: HeroSectionProps) { const [mobileTab, setMobileTab] = useState<'upload' | 'compare'>('upload'); const resolvedBadge = resolveLocalised(badge, locale) || 'Next-Gen Creative Vision AI'; const primaryCtaLabel = resolveLocalised(primaryCta?.label, locale, 'Explore the Magic'); const primaryCtaHref = primaryCta?.href || '#our-tools'; const secondaryCtaLabel = resolveLocalised(secondaryCta?.label, locale, 'Mobile App Studio'); const secondaryCtaHref = secondaryCta?.href || '#recommended-apps'; // 1. Dedicated Tool Detail Page Hero (when viewing /tools/[slug] with variant='toolHero') if (variant === 'toolHero' && tool) { const appName = homeApp ? resolveLocalised(homeApp.name, locale) : 'Mobile App'; const toolMedia = (tool as any).media; const primaryExample = tool.content?.examples?.[0] || { before: toolMedia?.before || `/management/pages/tools/${tool.slug}/media/before.jpg`, after: toolMedia?.after || `/management/pages/tools/${tool.slug}/media/after.jpg`, caption: 'Sub-pixel neural transformation details', }; return (
{/* Breadcrumb Navigation */} {/* Heading & Subtitle */}
Studio Neural Tool

{resolveLocalised(tool.name, locale)}

{resolveLocalised(tool.summary, locale)}

{/* Mobile Tab Switcher */}
{/* Intelligent Side-by-Side Tool Studio */}
{/* Column 1: Spacious, Prominent Upload Studio (lg:col-span-7) */}
setMobileTab('compare')} />
{/* Column 2: Sleeker, Focused Neural Transformation Preview (lg:col-span-5) */}
{/* Mobile Jump to Upload (Only on small screens) */}
{/* Clean Trust Indicators & Clickable App Links */}
Zero Storage Private Processing Lossless Quality {/* Clickable Mobile App Button Link */} {homeApp && ( Available in {appName} App 50 Bonus Credits & 4K ↗ )} {/* Clickable QR Code Trigger Pill */} {homeApp && ( Scan QR )}
); } // 2. Centered Directory & Info Page Hero (for /tools, /apps, /pricing, /trust, /privacy, /terms) if (variant === 'centered') { const resolvedTitle = resolveLocalised(title, locale) || 'Creative Studio'; const resolvedSubtitle = resolveLocalised(subtitle, locale); return (
{resolvedBadge && (
{resolvedBadge}
)}

{resolvedTitle}

{resolvedSubtitle && (

{resolvedSubtitle}

)}
Explore Studio Suite Mobile Apps Suite
); } // ------------------------------------------------------------- // 3. Pure Front Page Hero View (for homepage /): // Ultra-refined Typography, Optical Crystal Prism & Ambient Particles // ------------------------------------------------------------- return (
{/* 1. MagicUI Ambient Floating Particles */} {/* 2. Interactive 3D WebGL Crystal Prism Canvas (Desktop Only - Completely Removed on Phones & Mobile Devices) */}
{/* 3. Radiant Multidimensional Chromatic Glow Mesh */}
{/* 4. Center Hero Typography & Visual Atmosphere */}
{/* Ambient Frosted Eyebrow Badge */}
{resolvedBadge} v4.2 PRO
{/* Grand Headline: Masterpiece Proportions, Zero Awkward Wraps */}

Imagine. Transform. Create the Impossible.

{/* Inspiring, Refined Editorial Subtitle */}

Turn ordinary moments into extraordinary visual art. Instant, effortless, and private photo magic right in your browser.

{/* Luxury CTA Action Buttons */} {/* Floating Glass Telemetry & Capability Capsule */}
{/* Metric 1 */}
1.4M+
Photos Transformed
{/* Metric 2 */}
< 0.8s
Instant Inference
{/* Metric 3 */}
100%
Client-Side Privacy
{/* Metric 4 */}
4K UHD
Studio Resolution
{/* Subtle Luxury Scroll Cue */} Scroll to Explore
); }