'use client';
import { CountryFlagFormatter } from '@/lib/formatters/CountryFlagFormatter';
import { Group } from '@/ui/Group';
import { Input } from '@/ui/Input';
import { Panel } from '@/ui/Panel';
import { Stack } from '@/ui/Stack';
import { TextArea } from '@/ui/TextArea';
interface ProfileDetailsPanelProps {
driver: {
name: string;
country: string;
bio?: string | null;
};
isEditing?: boolean;
onUpdate?: (updates: { bio?: string; country?: string }) => void;
}
export function ProfileDetailsPanel({ driver, isEditing, onUpdate }: ProfileDetailsPanelProps) {
if (isEditing) {
return (
onUpdate?.({ country: e.target.value })}
placeholder="e.g. US, GB, DE"
/>
);
}
return (
Nationality
{CountryFlagFormatter.fromCountryCode(driver.country).toString()}
{driver.country}
Bio
{driver.bio || 'No bio provided.'}
);
}