From f80292cc1b19b3d6ddebd3299e9261f2b0e28372 Mon Sep 17 00:00:00 2001 From: 4Ventures <4ventures@MacBook-Air-de-4Ventures.local> Date: Tue, 13 Oct 2026 16:37:51 +0200 Subject: [PATCH] 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 --- src/app/dashboard/creatividades/page.tsx | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/app/dashboard/creatividades/page.tsx b/src/app/dashboard/creatividades/page.tsx index 70db5ab..713d05c 100644 --- a/src/app/dashboard/creatividades/page.tsx +++ b/src/app/dashboard/creatividades/page.tsx @@ -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 ( +
+ + +
+ ); + } + + if (agency && ctx.tenantId) { + return ( + + ); + } return ; }