almeira-web/src/app/login/page.tsx

49 lines
2.2 KiB
TypeScript

import { getEntity } from '@/app/actions/entity';
import LoginForm from './LoginForm';
import { Radio } from 'lucide-react';
export default async function LoginPage() {
const entity = await getEntity();
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}`;
}
return (
<div className="min-h-screen bg-[#0f172a] flex flex-col justify-center items-center p-4">
<div className="w-full max-w-md bg-slate-900 border border-slate-800 rounded-2xl shadow-2xl overflow-hidden animate-fade-in relative z-10">
{/* Glow effect */}
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-[200px] h-[100px] bg-blue-500/30 blur-[60px] rounded-full pointer-events-none"></div>
<div className="p-8">
<div className="flex flex-col items-center justify-center text-center mb-8 relative z-10">
{logoUrl ? (
<img src={logoUrl} alt={entity?.razon_social || "Logo"} className="h-20 w-auto max-w-full shrink-0 object-contain mb-4 drop-shadow-[0_0_15px_rgba(255,255,255,0.1)]" />
) : (
<div className="p-4 rounded-2xl bg-gradient-to-br from-cyan-500 to-blue-600 text-white shadow-lg mb-4">
<Radio size={48} className="animate-pulse" />
</div>
)}
{(!logoUrl || entity?.mostrar_texto_logo) && (
<h1 className="text-3xl font-black text-white mb-2 uppercase tracking-wide font-outfit">
{entity?.razon_social || "Almeira PRO"}
</h1>
)}
</div>
<LoginForm />
<p className="mt-8 text-center text-xs text-slate-500 relative z-10">
Área de administración segura. Si no eres administrador, retorna al <a href="/" className="text-blue-400 hover:underline">portal de noticias</a>.
</p>
</div>
</div>
</div>
);
}