import { isApiError } from '@impuestos/contracts'; import { ScanLine } from 'lucide-react'; import { setRequestLocale } from 'next-intl/server'; import { buttonClasses } from '@/components/ui/button'; import { Card } from '@/components/ui/card'; import { EmptyState } from '@/components/ui/empty-state'; import { Link, redirect } from '@/i18n/navigation'; import { getT } from '@/i18n/t'; import { serverApi } from '@/lib/api-server'; /** * Flow A6, the first run state. The dashboard proper (Flow C, with the position header, * next action strip and insight feed) replaces this body in phase 4; deadlines come from * the deadline engine then, not from a second copy of the rules in the browser. */ export default async function InicioPage({ params }: { params: Promise<{ locale: string }> }) { const { locale } = await params; setRequestLocale(locale); const t = await getT(locale); const api = await serverApi(); const profile = await api.getProfile().catch((error: unknown) => { if (!isApiError(error)) throw error; if (error.code === 'not_found') return null; if (error.code === 'unauthorized') redirect({ href: '/login', locale }); throw error; }); // No profile means setup was never finished, so send them there rather than showing an // empty shell they cannot act on. if (!profile) redirect({ href: '/configuracion', locale }); return (
{profile?.fullName}