import Image from "next/image"; import Link from "next/link"; import { ArrowUpRight } from "lucide-react"; import type { Category } from "@/lib/headless/types"; type TileContent = { subtitle: string; image?: string; color: string }; // No hay fotografia real todavia para las 6 categorias raiz de la taxonomia // (ver ADR 0005) -- solo se mapean imagen/subtitulo para las que ya tienen // un asset en public/images/categories/. Las demas caen al tile de solo // gradiente en vez de mostrar una imagen que no les corresponde. const tileContent: Record = { juguetes: { subtitle: "Personajes que inspiran", image: "/images/categories/figuras.webp", color: "from-yellow-300 to-orange-400" }, "mochilas-y-morrales": { subtitle: "Estilo para cada aventura", image: "/images/categories/mochilas.webp", color: "from-cyan-400 to-blue-500" }, "bebes-y-primera-infancia": { subtitle: "Primeros descubrimientos", color: "from-pink-300 to-fuchsia-400" }, educativos: { subtitle: "Aprender jugando", color: "from-emerald-400 to-teal-600" }, "accion-y-aventura": { subtitle: "Para explorar sin límites", color: "from-red-500 to-rose-700" }, variedades: { subtitle: "Un poco de todo", color: "from-violet-400 to-purple-600" }, }; const defaultTile: TileContent = { subtitle: "Explora esta categoría", color: "from-slate-400 to-slate-600" }; export function CategoryTiles({ categories }: { categories: Category[] }) { const roots = categories.filter((category) => !category.parentId); if (roots.length === 0) return null; return (
Explora por mundos

Encuentra tu próximo tesoro

Ver todo →
{roots.map((category) => { const content = tileContent[category.handle] ?? defaultTile; return ( {content.image && ( <> {category.name}
)}

{category.name}

{content.subtitle}

); })}
); }