di usage in website
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
'use client';
|
||||
|
||||
import { useDriverProfile } from '@/hooks/driver';
|
||||
import { useMemo } from 'react';
|
||||
import Card from '../ui/Card';
|
||||
import RankBadge from './RankBadge';
|
||||
import { useMemo } from 'react';
|
||||
import { useDriverProfile } from '@/hooks/useDriverService';
|
||||
|
||||
interface ProfileStatsProps {
|
||||
driverId?: string;
|
||||
@@ -206,35 +206,4 @@ export default function ProfileStats({ driverId, stats }: ProfileStatsProps) {
|
||||
);
|
||||
}
|
||||
|
||||
function PerformanceRow({ label, races, wins, podiums, avgFinish }: {
|
||||
label: string;
|
||||
races: number;
|
||||
wins: number;
|
||||
podiums: number;
|
||||
avgFinish: number;
|
||||
}) {
|
||||
const winRate = ((wins / races) * 100).toFixed(0);
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-between p-3 rounded bg-deep-graphite border border-charcoal-outline">
|
||||
<div className="flex-1">
|
||||
<div className="text-white font-medium">{label}</div>
|
||||
<div className="text-gray-500 text-xs">{races} races</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-6 text-xs">
|
||||
<div>
|
||||
<div className="text-gray-500">Wins</div>
|
||||
<div className="text-green-400 font-medium">{wins} ({winRate}%)</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-gray-500">Podiums</div>
|
||||
<div className="text-warning-amber font-medium">{podiums}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-gray-500">Avg</div>
|
||||
<div className="text-white font-medium">{avgFinish.toFixed(1)}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user