Agency still sees the full Drive tree and portal uploads; clients only see Pipeline-creatividades / calendarios / brandbook-style paths. Co-authored-by: Cursor <cursoragent@cursor.com>
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
import { createClient } from '@/lib/supabase/server';
|
|
import { redirect } from 'next/navigation';
|
|
import { resolveActiveTenant } from '@/lib/tenant-context';
|
|
import { isAgencyRole, userRole } from '@/lib/agency';
|
|
import AssetsLibrary from '@/components/AssetsLibrary';
|
|
import { EmptyState, PageHeader } from '@/components/ui';
|
|
|
|
export const dynamic = 'force-dynamic';
|
|
|
|
export default async function ActivosPage() {
|
|
const supabase = await createClient();
|
|
const {
|
|
data: { user },
|
|
} = await supabase.auth.getUser();
|
|
if (!user) redirect('/login');
|
|
|
|
const ctx = await resolveActiveTenant(user);
|
|
const agency = isAgencyRole(userRole(user));
|
|
|
|
if (ctx.portfolioWide) {
|
|
return (
|
|
<div className="space-y-6">
|
|
<PageHeader
|
|
eyebrow="Contenido"
|
|
title="Activos"
|
|
description="Biblioteca de archivos validados por cliente."
|
|
/>
|
|
<EmptyState
|
|
title="Elige un cliente"
|
|
description="Selecciona un tenant en Contexto para subir o consultar archivos."
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return <AssetsLibrary tenantLabel={ctx.label} isAgency={agency} />;
|
|
}
|