feat(F-062): completed feature

This commit is contained in:
chattie
2026-08-19 17:02:14 +02:00
parent e0411bc5a4
commit 52e30c39d7
12 changed files with 1246 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
'use client';
import { useState, useEffect, useCallback } from 'react';
import { cmsApi } from '@/lib/api-client';
import LexicalEditor from '@/features/cms/components/LexicalEditor';
interface Page { id: string; slug: string; title: string; body: string; status: string; createdAt: string; updatedAt: string; }
@@ -92,7 +93,11 @@ export default function CmsPage() {
))}
<div>
<label className="block text-sm font-medium text-gray-700 mb-1">Contenido *</label>
<textarea value={form.body} onChange={e => setForm({...form,body:e.target.value})} rows={6} className="w-full px-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:ring-2 focus:ring-[#2D6A4F] outline-none resize-none font-mono" />
<LexicalEditor
value={form.body}
onChange={(html) => setForm((f) => ({ ...f, body: html }))}
placeholder="Escribe el contenido de la página…"
/>
</div>
<div className="flex gap-3">
<button onClick={handleSave} disabled={saving || !form.slug || !form.title || !form.body} className="px-5 py-2.5 bg-[#2D6A4F] hover:bg-[#1B4332] disabled:opacity-50 text-white text-sm font-semibold rounded-xl">{saving ? 'Guardando...' : (editing ? 'Guardar cambios' : 'Crear')}</button>