import { PageLayout } from '@/components/admin/shared/PageLayout'; import { HeroSection } from '@/components/admin/shared/HeroSection'; import { Button } from '@/components/ui/button'; import Link from 'next/link'; import { PlusCircle, ArrowLeft, Database, Calendar, Edit, Eye, Sparkles, FileText, Clock } from 'lucide-react'; interface ContentType { id: string; name: string; description: string | null; apiIdentifier: string; fields: Array<{ id: string; label: string; }>; entries: Array<{ id: string; data: any; createdAt: Date; updatedAt: Date; }>; } interface ContentEntriesListProps { contentType: ContentType; } export function ContentEntriesList({ contentType }: ContentEntriesListProps) { return ( <> 0 ? new Date(contentType.entries[0].updatedAt).toLocaleDateString('es-ES') : 'Sin entradas', label: "Última Actualización", color: "text-purple-600" } ]} /> {/* Botón de crear */}
{/* Contenido principal */}

Todas las Entradas

{contentType.entries.length} {contentType.entries.length === 1 ? 'entrada' : 'entradas'} en total

{contentType.entries.length > 0 ? ( ) : ( )}
); } function EntriesGrid({ contentType }: { contentType: ContentType }) { return (
{contentType.entries.map((entry, index) => ( ))}
); } function EntryCard({ entry, contentType, index }: { entry: ContentType['entries'][0]; contentType: ContentType; index: number; }) { // Extraer título del JSON data o usar valor por defecto const entryData = entry.data as any; const title = entryData?.title || entryData?.name || entryData?.titulo || `Entrada #${entry.id.slice(-6)}`; return (
{/* Efecto de fondo al hover */}
{/* Header */}
{contentType.name}
{/* Contenido */}

{title}

Creado el {new Date(entry.createdAt).toLocaleDateString('es-ES')}

{/* Acciones */}
); } function EmptyState({ contentType }: { contentType: ContentType }) { return (

No hay entradas todavía

Crea tu primera entrada de {contentType.name.toLowerCase()} para comenzar a organizar tu contenido.

); }