'use client'; import { useMemo, useState } from 'react'; import type { ElementType } from 'react'; import Link from 'next/link'; import { ArrowRight, Layers, Palette, Scissors, Smile, Sparkles } from 'lucide-react'; import { AppItem, CategoryItem, resolveLocalised, ToolItem } from '@/types'; import { CardBeforeAfterSlider } from '@/components/ui/CardBeforeAfterSlider'; interface VerticalToolStackProps { context: { tools: ToolItem[]; categories: CategoryItem[]; apps: AppItem[]; locale: string }; } const icons: Record = { Smile, Sparkles, Scissors, Palette, Layers }; const fallbackImage = '/management/pages/home/media/sample_portrait_1.jpg'; export function VerticalToolStackSection({ context }: VerticalToolStackProps) { const { tools, categories, apps, locale } = context; const [category, setCategory] = useState('all'); const visibleCategories = useMemo( () => category === 'all' ? categories : categories.filter((item) => item.slug === category), [categories, category] ); return (

THE CREATIVE STUDIO SUITE

Find the right tool, fast.

Choose a creative task, see a real preview, and start your edit in one tap.

setCategory('all')} label="All tools" count={tools.length} icon={Layers} /> {categories.map((item) => { const Icon = icons[item.icon || 'Sparkles'] || Sparkles; return setCategory(item.slug)} label={resolveLocalised(item.name, locale)} count={tools.filter((tool) => tool.category === item.slug).length} icon={Icon} />; })}
{visibleCategories.map((item) => { const categoryTools = tools.filter((tool) => tool.category === item.slug); if (!categoryTools.length) return null; const Icon = icons[item.icon || 'Sparkles'] || Sparkles; return (

{resolveLocalised(item.name, locale)}

{resolveLocalised(item.description, locale)}

{categoryTools.length} tools
{categoryTools.map((tool) => item.id === tool.homeApp)} locale={locale} />)}
); })}
); } function FilterButton({ active, onClick, label, count, icon: Icon }: { active: boolean; onClick: () => void; label: string; count: number; icon: ElementType }) { return ( ); } function ToolCard({ tool, app, locale }: { tool: ToolItem; app?: AppItem; locale: string }) { const example = tool.content?.examples?.[0]; const hasComparison = !!(example?.before && example?.after); const image = example?.after || example?.before || fallbackImage; return (
{hasComparison ? ( ) : ( /* eslint-disable-next-line @next/next/no-img-element */ {resolveLocalised(tool.name, )} {tool.category.replace('-', ' ')}

{resolveLocalised(tool.name, locale)}

{resolveLocalised(tool.summary, locale)}

Try it {app && ( Get app )}
); }