'use client'; import React from 'react'; import { DriversTemplate } from '@/templates/DriversTemplate'; import type { DriverLeaderboardViewModel } from '@/lib/view-models/DriverLeaderboardViewModel'; interface DriversPageClientProps { pageDto: DriverLeaderboardViewModel | null; error?: string; empty?: { title: string; description: string; }; } /** * DriversPageClient * * Client component that: * 1. Passes ViewModel directly to Template * * No business logic, filtering, or sorting here. * All data transformation happens in the PageQuery and ViewModelBuilder. */ export function DriversPageClient({ pageDto, error, empty }: DriversPageClientProps) { // Handle error/empty states if (error) { return (
Error loading drivers

Please try again later

); } if (!pageDto || pageDto.drivers.length === 0) { if (empty) { return (

{empty.title}

{empty.description}

); } return null; } // Pass ViewModel directly to template return ; }