'use client'; import React, { useState } from 'react'; import { useRouter } from 'next/navigation'; import { DriverProfileTemplate } from '@/templates/DriverProfileTemplate'; import { DriverProfileViewModelBuilder } from '@/lib/builders/view-models/DriverProfileViewModelBuilder'; import type { GetDriverProfileOutputDTO } from '@/lib/types/generated/GetDriverProfileOutputDTO'; interface DriverProfilePageClientProps { pageDto: GetDriverProfileOutputDTO | null; error?: string; empty?: { title: string; description: string; }; } /** * DriverProfilePageClient * * Client component that: * 1. Handles UI state (tabs, friend requests) * 2. Uses ViewModelBuilder to transform DTO * 3. Passes ViewModel to Template */ export function DriverProfilePageClient({ pageDto, error, empty }: DriverProfilePageClientProps) { const router = useRouter(); // UI State const [activeTab, setActiveTab] = useState<'overview' | 'stats'>('overview'); const [friendRequestSent, setFriendRequestSent] = useState(false); // Event handlers const handleAddFriend = () => { setFriendRequestSent(true); }; const handleBackClick = () => { router.push('/drivers'); }; // Handle error/empty states if (error) { return (
Please try again later
{empty.description}