diff --git a/src/app/dashboard/entity/page.tsx b/src/app/dashboard/entity/page.tsx
index 3f95670..91e8526 100644
--- a/src/app/dashboard/entity/page.tsx
+++ b/src/app/dashboard/entity/page.tsx
@@ -2,6 +2,7 @@ import { getEntity, updateEntity } from '@/app/actions/entity';
import { Building, Image as ImageIcon, Link as LinkIcon, Share2, Tv, RadioTower, Facebook, Instagram, Twitter, Youtube, Send, Mail, Globe, MapPin, Phone, MessageSquare } from 'lucide-react';
import { createSessionClient } from '@/lib/appwrite.server';
import { APPWRITE_ALMEIRA_CONFIG } from '@/lib/appwrite';
+import EntityLogoField from '@/components/dashboard/EntityLogoField';
export default async function EntityPage() {
let entity: any = null;
@@ -59,20 +60,7 @@ export default async function EntityPage() {
/>
-
-
- {entity?.logotipo && (
-
-
-
- )}
-
-
+
diff --git a/src/components/dashboard/EntityLogoField.tsx b/src/components/dashboard/EntityLogoField.tsx
new file mode 100644
index 0000000..a52d335
--- /dev/null
+++ b/src/components/dashboard/EntityLogoField.tsx
@@ -0,0 +1,41 @@
+'use client';
+
+import { useState } from 'react';
+import { MediaGridSelector } from './MediaGridSelector';
+
+export default function EntityLogoField({
+ initialUrl = '',
+ initialId = ''
+}: {
+ initialUrl?: string,
+ initialId?: string
+}) {
+ // Si la entidad viene con url vieja, guardamos la url final. Si se escoge nueva, guardamos la url o el id según convenga.
+ // MediaGridSelector espera el ID del documento para hacer el preview.
+ const [mediaId, setMediaId] = useState(initialId);
+ const [finalUrl, setFinalUrl] = useState(initialUrl);
+
+ return (
+
+ {
+ setMediaId(id);
+ setFinalUrl(url || '');
+ }}
+ label="Logotipo Corporativo"
+ />
+ {/* Si no hay mediaId activo pero sí URL antigua (legacy), la mostramos */}
+ {!mediaId && finalUrl && (
+