import { onMount } from 'solid-js';
import { useNavigate, useSearchParams } from '@solidjs/router';

export default function CustomerOnboardingRoute() {
  const navigate = useNavigate();
  const [search] = useSearchParams();

  onMount(() => {
    const params = new URLSearchParams({
      roleKey: 'CUSTOMER',
      schemaId: 'customer_onboarding_v1',
    });
    if (search.intent) params.set('intent', String(search.intent));
    navigate(`/onboarding?${params.toString()}`, { replace: true });
  });

  return null;
}
