import type { SoundAsset } from './types';
import * as feedback from './audio/feedback';
import * as game from './audio/game';
import * as impact from './audio/impact';
import * as sciFi from './audio/sci-fi';
import * as ui from './audio/ui';

type Category = {
  id: string;
  label: string;
  sounds: SoundAsset[];
};

const toArray = (mod: Record<string, SoundAsset>): SoundAsset[] => Object.values(mod);

export const categories: Category[] = [
  { id: 'ui', label: 'UI', sounds: toArray(ui as unknown as Record<string, SoundAsset>) },
  { id: 'feedback', label: 'Feedback', sounds: toArray(feedback as unknown as Record<string, SoundAsset>) },
  { id: 'game', label: 'Game', sounds: toArray(game as unknown as Record<string, SoundAsset>) },
  { id: 'impact', label: 'Impact', sounds: toArray(impact as unknown as Record<string, SoundAsset>) },
  { id: 'sci-fi', label: 'Sci-Fi', sounds: toArray(sciFi as unknown as Record<string, SoundAsset>) },
];

export const allSounds: SoundAsset[] = categories.flatMap((c) => c.sounds);
