import { redirect } from 'next/navigation'; import { getApi } from '@/server/caller'; import { RoleChooser } from './role-chooser'; export const metadata = { title: 'Welcome' }; export const dynamic = 'force-dynamic'; /** * Role selection. * * Google signup lands everyone on the `client` default, so a tradesperson would * otherwise reach the customer deck with the wrong account type. Phone signup * has the same problem. This is the fork. */ export default async function OnboardingPage() { const api = await getApi(); let me: Awaited>; try { me = await api.user.me(); } catch { redirect('/sign-in?next=/onboarding'); } // Someone who already committed to a role does not need to see this again. if (me.role === 'admin') redirect('/admin'); if (me.role === 'pro') redirect(me.hasProProfile ? '/pro' : '/pro/onboarding'); return (

What brings you here?

You can only pick once, so choose the one that fits.

); }