/**
 * Media configuration for GridPilot website.
 * Single source of truth for all media asset paths and URLs.
 *
 * Note: This config should be kept in sync with the shared MediaAssetConfig
 * in adapters/bootstrap/MediaAssetConfig.ts
 */

export interface MediaConfig {
  avatars: {
    defaultFallback: string;
    paths: {
      male: string;
      female: string;
      neutral: string;
    };
  };
  api: {
    avatar: (driverId: string) => string;
    teamLogo: (teamId: string) => string;
    trackImage: (trackId: string) => string;
    sponsorLogo: (sponsorId: string) => string;
    categoryIcon: (categoryId: string) => string;
  };
}

export const mediaConfig: MediaConfig = {
  avatars: {
    // Default fallback used when no avatar URL is available
    defaultFallback: '/images/avatars/neutral-default-avatar.jpeg',
    
    // Individual avatar type paths
    paths: {
      male: '/images/avatars/male-default-avatar.jpg',
      female: '/images/avatars/female-default-avatar.jpeg',
      neutral: '/images/avatars/neutral-default-avatar.jpeg',
    },
  },
  
  api: {
    // Direct media paths (no /api/ prefix) - served by website or API
    avatar: (driverId: string) => `/media/avatar/${driverId}`,
    teamLogo: (teamId: string) => `/media/teams/${teamId}/logo`,
    trackImage: (trackId: string) => `/media/tracks/${trackId}/image`,
    sponsorLogo: (sponsorId: string) => `/media/sponsors/${sponsorId}/logo`,
    categoryIcon: (categoryId: string) => `/media/categories/${categoryId}/icon`,
  },
} as const;

export type MediaConfigType = typeof mediaConfig;