This commit is contained in:
2025-12-18 14:48:37 +01:00
parent b476bb7e99
commit f54fa5de5b
23 changed files with 699 additions and 543 deletions

View File

@@ -0,0 +1,37 @@
import { LeagueRole } from '@/lib/types/LeagueRole';
export interface LeagueRoleDisplayData {
text: string;
badgeClasses: string;
}
export class LeagueRoleDisplay {
/**
* Centralized display configuration for league membership roles.
*/
static getLeagueRoleDisplay(role: LeagueRole): LeagueRoleDisplayData {
switch (role) {
case 'owner':
return {
text: 'Owner',
badgeClasses: 'bg-yellow-500/10 text-yellow-500 border-yellow-500/30',
};
case 'admin':
return {
text: 'Admin',
badgeClasses: 'bg-purple-500/10 text-purple-400 border-purple-500/30',
};
case 'steward':
return {
text: 'Steward',
badgeClasses: 'bg-blue-500/10 text-blue-400 border-blue-500/30',
};
case 'member':
default:
return {
text: 'Member',
badgeClasses: 'bg-primary-blue/10 text-primary-blue border-primary-blue/30',
};
}
}
}

View File

@@ -0,0 +1,14 @@
export class LeagueWizardValidationMessages {
static readonly LEAGUE_NAME_REQUIRED = 'League name is required';
static readonly LEAGUE_NAME_TOO_SHORT = 'League name must be at least 3 characters';
static readonly LEAGUE_NAME_TOO_LONG = 'League name must be less than 100 characters';
static readonly DESCRIPTION_TOO_LONG = 'Description must be less than 500 characters';
static readonly VISIBILITY_REQUIRED = 'Visibility is required';
static readonly MAX_DRIVERS_INVALID_SOLO = 'Max drivers must be greater than 0 for solo leagues';
static readonly MAX_DRIVERS_TOO_HIGH = 'Max drivers cannot exceed 100';
static readonly MAX_TEAMS_INVALID_TEAM = 'Max teams must be greater than 0 for team leagues';
static readonly DRIVERS_PER_TEAM_INVALID = 'Drivers per team must be greater than 0';
static readonly QUALIFYING_DURATION_INVALID = 'Qualifying duration must be greater than 0 minutes';
static readonly MAIN_RACE_DURATION_INVALID = 'Main race duration must be greater than 0 minutes';
static readonly SCORING_PRESET_OR_CUSTOM_REQUIRED = 'Select a scoring preset or enable custom scoring';
}