website cleanup

This commit is contained in:
2025-12-24 14:01:52 +01:00
parent a7aee42409
commit 9b683a59d3
65 changed files with 880 additions and 745 deletions

View File

@@ -1,6 +1,7 @@
'use client';
import type { DriverDTO } from '@/lib/types/generated/DriverDTO';
import type { DriverProfileStatsViewModel } from '@/lib/view-models/DriverProfileViewModel';
import Card from '../ui/Card';
import ProfileHeader from '../profile/ProfileHeader';
import ProfileStats from './ProfileStats';
@@ -15,20 +16,6 @@ interface DriverProfileProps {
isOwnProfile?: boolean;
onEditClick?: () => void;
}
interface DriverProfileStatsViewModel {
rating: number;
wins: number;
podiums: number;
dnfs: number;
totalRaces: number;
avgFinish: number;
bestFinish: number;
worstFinish: number;
consistency: number;
percentile: number;
overallRank?: number;
}
interface DriverTeamViewModel {
team: {

View File

@@ -1,14 +1,14 @@
'use client';
import { useState } from 'react';
import type { DriverDTO } from '@/lib/types/generated/DriverDTO';
import type { DriverProfileDriverSummaryViewModel } from '@/lib/view-models/DriverProfileViewModel';
import Card from '../ui/Card';
import Button from '../ui/Button';
import Input from '../ui/Input';
interface ProfileSettingsProps {
driver: DriverDTO;
onSave?: (updates: Partial<DriverDTO>) => void;
driver: DriverProfileDriverSummaryViewModel;
onSave?: (updates: { bio?: string; country?: string }) => void;
}
export default function ProfileSettings({ driver, onSave }: ProfileSettingsProps) {

View File

@@ -21,8 +21,8 @@ import {
Globe,
Medal,
} from 'lucide-react';
import type { LeagueConfigFormModel } from '@core/racing/application';
import type { LeagueScoringPresetDTO } from '@core/racing/application/ports/LeagueScoringPresetProvider';
import type { LeagueConfigFormModel } from '@/lib/types/LeagueConfigFormModel';
import type { LeagueScoringPresetDTO } from '@/lib/types/generated/LeagueScoringPresetDTO';
interface LeagueReviewSummaryProps {
form: LeagueConfigFormModel;

View File

@@ -1,11 +1,15 @@
'use client';
import { Calendar, Users, Trophy, Gamepad2, Eye, Hash, Award } from 'lucide-react';
import type { LeagueConfigFormModel } from '@core/racing/application';
import type { League } from '@core/racing/domain/entities/League';
import type { LeagueConfigFormModel } from '@/lib/types/LeagueConfigFormModel';
interface ReadonlyLeagueInfoProps {
league: League;
league: {
id: string;
name: string;
ownerId: string;
createdAt?: string;
};
configForm: LeagueConfigFormModel;
}
@@ -46,11 +50,11 @@ export function ReadonlyLeagueInfo({ league, configForm }: ReadonlyLeagueInfoPro
{
icon: Calendar,
label: 'Created',
value: new Date(league.createdAt).toLocaleDateString('en-US', {
value: league.createdAt ? new Date(league.createdAt).toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
year: 'numeric',
}),
}) : '—',
},
{
icon: Trophy,

View File

@@ -1,13 +1,13 @@
'use client';
import Image from 'next/image';
import type { DriverDTO } from '@core/racing/application/dto/DriverDTO';
import type { GetDriverOutputDTO } from '@/lib/types/generated/GetDriverOutputDTO';
import Button from '../ui/Button';
import DriverRatingPill from '@/components/profile/DriverRatingPill';
import CountryFlag from '@/components/ui/CountryFlag';
interface ProfileHeaderProps {
driver: DriverDTO;
driver: GetDriverOutputDTO;
rating?: number | null;
rank?: number | null;
isOwnProfile?: boolean;

View File

@@ -2,14 +2,14 @@
import Link from 'next/link';
import { ChevronRight } from 'lucide-react';
import { Race } from '@core/racing/domain/entities/Race';
import { Result } from '@core/racing/domain/entities/Result';
import { League } from '@core/racing/domain/entities/League';
import type { RaceDetailRaceDTO } from '@/lib/types/generated/RaceDetailRaceDTO';
import type { RaceResultDTO } from '@/lib/types/generated/RaceResultDTO';
import type { RaceDetailLeagueDTO } from '@/lib/types/generated/RaceDetailLeagueDTO';
interface RaceResultCardProps {
race: Race;
result: Result;
league?: League;
race: RaceDetailRaceDTO;
result: RaceResultDTO;
league?: RaceDetailLeagueDTO;
showLeague?: boolean;
}
@@ -46,7 +46,7 @@ export default function RaceResultCard({
<div className="flex items-center gap-3">
<div className="text-right">
<div className="text-sm text-gray-400">
{race.scheduledAt.toLocaleDateString('en-US', {
{new Date(race.scheduledAt).toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
year: 'numeric',

View File

@@ -2,11 +2,11 @@ import React from 'react';
import { Calendar, Trophy, Users, Zap } from 'lucide-react';
interface RaceResultsHeaderProps {
raceTrack?: string;
raceScheduledAt?: string;
totalDrivers?: number;
leagueName?: string;
raceSOF?: number | null;
raceTrack: string | undefined;
raceScheduledAt: string | undefined;
totalDrivers: number | undefined;
leagueName: string | undefined;
raceSOF: number | null | undefined;
}
const DEFAULT_RACE_TRACK = 'Race';