import React from 'react'; import { createClient } from '@/lib/supabase/server'; import { logoutAction } from '@/app/auth/actions'; import { cookies } from 'next/headers'; import { VIEW_TENANT_NAME_COOKIE } from '@/lib/agency'; import DashboardShell from '@/components/DashboardShell'; export default async function DashboardLayout({ children, }: { children: React.ReactNode; }) { const supabase = await createClient(); const { data: { user }, } = await supabase.auth.getUser(); const role = user?.user_metadata?.role || user?.app_metadata?.role || 'client'; const company = user?.user_metadata?.company || '4Ventures Central'; const email = user?.email || 'usuario@4ventures.es'; const isAgency = role === 'admin' || role === 'team'; const cookieStore = await cookies(); const viewName = cookieStore.get(VIEW_TENANT_NAME_COOKIE)?.value; return ( {children} ); }