Show agency creatives board when a client is selected in Contexto.
Creatividades Ads was always rendering the client approval UI, so agency never saw Pedir relevo / kanban on that route. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,7 +2,10 @@ 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 ClientCreativesView from '@/components/ClientCreativesView';
|
||||
import AgencyCreativesView from '@/components/AgencyCreativesView';
|
||||
import { EmptyState, PageHeader } from '@/components/ui';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
@@ -15,6 +18,33 @@ export default async function CreatividadesPage() {
|
||||
if (!user) redirect('/login');
|
||||
|
||||
const ctx = await resolveActiveTenant(user);
|
||||
const agency = isAgencyRole(userRole(user));
|
||||
|
||||
// Agencia en vista global: hay que elegir cliente para pedir relevos / kanban
|
||||
if (agency && ctx.portfolioWide) {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<PageHeader
|
||||
eyebrow="Meta Ads & Creatividades"
|
||||
title="Creatividades Ads"
|
||||
description="Kanban, brief y peticiones a Claude por cliente."
|
||||
/>
|
||||
<EmptyState
|
||||
title="Elige un cliente"
|
||||
description="Estás en Vista global agencia. Selecciona un tenant en Contexto para ver el panel de producción (Pedir relevo a Claude, Estilo/Brief, Cola)."
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (agency && ctx.tenantId) {
|
||||
return (
|
||||
<AgencyCreativesView
|
||||
tenantId={ctx.tenantId}
|
||||
clientName={ctx.label || 'Cliente'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return <ClientCreativesView tenantName={ctx.label || 'Cliente'} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user