import { PageLayout } from '@/components/admin/shared/PageLayout'; import { HeroSection } from '@/components/admin/shared/HeroSection'; import { FormContainer } from '@/components/admin/shared/FormContainer'; import { DynamicContentForm } from '@/components/cms/HeadlessCMS/DynamicContentForm'; import { PlusCircle, Sparkles, FileText } from 'lucide-react'; interface ContentType { id: string; name: string; apiIdentifier: string; description?: string; fields: Array<{ id: string; label: string; apiIdentifier: string; type: 'TEXT' | 'RICH_TEXT' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'MEDIA'; isRequired: boolean; }>; } interface CreateContentFormProps { contentType: ContentType; onSave: (data: Record) => Promise; } export function CreateContentForm({ contentType, onSave }: CreateContentFormProps) { return ( <> f.isRequired).length, label: "Requeridos", color: "text-emerald-600" }, { value: contentType.fields.filter(f => !f.isRequired).length, label: "Opcionales", color: "text-green-700" } ]} /> ); } function FieldsPreview({ fields }: { fields: ContentType['fields'] }) { return (
Campos a completar:
{fields.map((field, index) => ( ))}
); } function FieldChip({ field, index }: { field: ContentType['fields'][0]; index: number }) { return (
{index + 1} {field.label} {field.isRequired && ( Requerido )}
); }