'use client';

import { DashboardTemplate } from '@/templates/DashboardTemplate';
import type { DashboardViewData } from '@/lib/view-data/DashboardViewData';
import { ClientWrapperProps } from '@/lib/contracts/components/ComponentContracts';
import { useRouter } from 'next/navigation';
import { routes } from '@/lib/routing/RouteConfig';

/**
 * DashboardPageClient
 * 
 * Client wrapper for the Dashboard page.
 * Manages client-side interactions for the dashboard.
 */
export function DashboardPageClient({ viewData }: ClientWrapperProps<DashboardViewData>) {
  const router = useRouter();

  const handleNavigateToRaces = () => router.push(routes.public.races);

  return (
    <DashboardTemplate 
      viewData={viewData} 
      onNavigateToRaces={handleNavigateToRaces}
    />
  );
}
