-
+
+
)}
- {(!entity?.logotipo || entity?.mostrar_texto_logo) && (
+ {(!logoUrl || entity?.mostrar_texto_logo) && (
{entity?.razon_social || "Almeira PRO"}
diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx
index 2260e56..98d0eff 100644
--- a/src/components/Navbar.tsx
+++ b/src/components/Navbar.tsx
@@ -11,6 +11,13 @@ export const Navbar = ({ entity }: { entity?: any }) => {
const [user, setUser] = useState
(null);
const pathname = usePathname();
+ const ENDPOINT = process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT || 'https://appwrite.almeira.com.co/v1';
+ const PROJECT_ID = process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID || '69b84df5003bd8957c5c';
+ let logoUrl = entity?.logotipo || null;
+ if (logoUrl && !logoUrl.startsWith('http') && !logoUrl.startsWith('/')) {
+ logoUrl = `${ENDPOINT}/storage/buckets/media/files/${logoUrl}/view?project=${PROJECT_ID}`;
+ }
+
useEffect(() => {
const handleScroll = () => setScrolled(window.scrollY > 20);
window.addEventListener('scroll', handleScroll);
@@ -41,10 +48,10 @@ export const Navbar = ({ entity }: { entity?: any }) => {
{/* Brand Logo Holográfico */}
- {entity?.logotipo ? (
+ {logoUrl ? (
-

+
) : (
@@ -55,7 +62,7 @@ export const Navbar = ({ entity }: { entity?: any }) => {
)}
- {(!entity?.logotipo || entity?.mostrar_texto_logo) && (
+ {(!logoUrl || entity?.mostrar_texto_logo) && (
{entity?.razon_social ? (
entity.razon_social.split(' ').map((word: string, i: number, arr: string[]) =>
diff --git a/src/components/TopBanner.tsx b/src/components/TopBanner.tsx
index 8487cda..11e67a2 100644
--- a/src/components/TopBanner.tsx
+++ b/src/components/TopBanner.tsx
@@ -58,13 +58,13 @@ export default function TopBanner({ initialBanners, rotationSeconds }: { initial
{/* Metric Impression Observer resets key on change to fire new impression */}
-
+
{/* eslint-disable-next-line @next/next/no-img-element */}

{activeBanner.url_destino && (