'use client'; import React, { useState } from 'react'; import Link from 'next/link'; import { Sparkles, Scissors, Wand2, Palette, Video, SunMedium, Layers, ArrowRight, GripHorizontal, Smile, Camera, Eye, Eraser, Film } from 'lucide-react'; import { TextAnimate } from '@/components/magicui/text-animate'; interface TrendyBentoSectionProps { title?: string; badge?: string; subtitle?: string; } export type EffectCategory = 'all' | 'portrait' | 'cutout' | 'restore' | 'creative'; interface TileItem { id: string; name: string; description: string; category: EffectCategory; href: string; cta: string; badge: string; icon: React.ElementType; imageUrl: string; } const CATEGORIES: { id: EffectCategory; label: string }[] = [ { id: 'all', label: 'All Effects' }, { id: 'portrait', label: 'Portrait & Beauty' }, { id: 'cutout', label: 'Cutout & Matting' }, { id: 'restore', label: 'Restoration & 4K' }, { id: 'creative', label: 'Creative & Anime' }, ]; const INITIAL_TILES: TileItem[] = [ { id: 'tile-matting', name: 'Hair-Strand Matting', description: 'Flyaway hair boundary separation with sub-pixel alpha matting.', category: 'cutout', href: '/tools/background-remover', cta: 'Try Matting', badge: 'TRENDING CUTOUT', icon: Scissors, imageUrl: '/management/pages/home/sections/trendy-bento/media/matting.jpg', }, { id: 'tile-restore', name: '4K Face Restore', description: 'Generative restoration preserving real skin pores and eyelashes.', category: 'restore', href: '/tools/old-photo-restorer', cta: 'Restore Photo', badge: '4K RESTORE', icon: Wand2, imageUrl: '/management/pages/home/sections/trendy-bento/media/restore.jpg', }, { id: 'tile-anime', name: 'AnimeGAN Synthesis', description: 'Transform portraits into high-definition anime illustrations.', category: 'creative', href: '/tools/cartoon-avatar', cta: 'Create Avatar', badge: 'VIRAL ANIME', icon: Sparkles, imageUrl: '/management/pages/home/sections/trendy-bento/media/anime.jpg', }, { id: 'tile-video', name: 'Video Retouching', description: 'Temporal epidermal smoothing across 4K dynamic video clips.', category: 'portrait', href: '/tools/blemish-remover', cta: 'Watch Reel', badge: '4K 60FPS', icon: Video, imageUrl: '/management/pages/home/sections/trendy-bento/media/video.jpg', }, { id: 'tile-color', name: 'Deep Colorizer', description: 'Reconstruct vintage monochrome family archives with rich pigments.', category: 'restore', href: '/tools/colorization', cta: 'Colorize Archive', badge: 'ARCHIVAL AI', icon: Palette, imageUrl: '/management/pages/home/sections/trendy-bento/media/color.jpg', }, { id: 'tile-relight', name: 'Studio Relight', description: 'Virtual three-point studio softbox illumination and portrait retouch.', category: 'portrait', href: '/tools/blemish-remover', cta: 'Relight Portrait', badge: 'STUDIO GRADE', icon: SunMedium, imageUrl: '/management/pages/home/sections/trendy-bento/media/portrait.jpg', }, { id: 'tile-teeth', name: 'Teeth Whitener AI', description: 'Enamel luminosity brightening with natural gum tone preservation.', category: 'portrait', href: '/tools/teeth-whitener', cta: 'Brighten Smile', badge: 'SMILE ENHANCE', icon: Smile, imageUrl: '/management/pages/home/sections/trendy-bento/media/teeth.jpg', }, { id: 'tile-cutout-studio', name: 'E-Commerce White Studio', description: 'Instant clean white backdrops and transparent PNG exports for shops.', category: 'cutout', href: '/tools/background-remover', cta: 'Cutout Product', badge: 'ECOMMERCE', icon: Eraser, imageUrl: '/management/pages/home/sections/trendy-bento/media/matting.jpg', }, { id: 'tile-polaroid', name: 'Vintage Polaroid', description: 'Warm analog grain, authentic border frames, and vintage flash tones.', category: 'creative', href: '/tools/polaroid-maker', cta: 'Make Polaroid', badge: 'VINTAGE FILM', icon: Camera, imageUrl: '/management/pages/home/sections/trendy-bento/media/polaroid.jpg', }, { id: 'tile-eyes', name: 'Iris Glint Sharpener', description: 'Crystal-clear eye reflections and sub-millimeter pupil depth enhancement.', category: 'restore', href: '/tools/photo-enhancer', cta: 'Sharpen Eyes', badge: '4K CLARITY', icon: Eye, imageUrl: '/management/pages/home/media/landscape_enhancer_after.jpg', }, ]; export function TrendyBentoSection({ title = 'Trendy Neural Effects', badge = 'EXPLORE CATEGORIES', subtitle = 'Discover our collection of viral AI effects. Tap any category to explore specialized tools.', }: TrendyBentoSectionProps) { const [activeCategory, setActiveCategory] = useState('all'); const tiles = INITIAL_TILES; // Filtered tiles based on category const displayedTiles = activeCategory === 'all' ? tiles : tiles.filter((t) => t.category === activeCategory); return (
{/* Symbolic Elemental Ambient Background Animation */}
{/* Header */}
{badge}

{title}

{subtitle}

{/* Category Filter Pills (Expands Scrolling View) */}
{CATEGORIES.map((cat) => { const isActive = cat.id === activeCategory; const count = cat.id === 'all' ? tiles.length : tiles.filter((t) => t.category === cat.id).length; return ( ); })}
{/* Squarical Tile Grid (100% Squarical by default, expandable 2x1) */}
{displayedTiles.map((tile) => { const Icon = tile.icon; const tileClasses = 'col-span-1 aspect-square rounded-[36px] sm:rounded-[42px]'; return ( {/* GPU-composited shadow elevation layer */}
); }