import { listGames } from '../data/games/index.js';
import { escapeHtml } from './formatters.js';
const ALL_METHODS = [
'all',
'Walking',
'Horde',
'Old Rod',
'Good Rod',
'Super Rod',
'Surf',
'Rock Smash',
'Dive',
'DexNav Hidden',
'Mirage Spot',
'Soaring',
'Gift',
'Gift Egg',
'Trade',
'Static',
'Fossil',
'Breeding',
'Evolution',
];
export function renderHeader(game, state, progress, profilesWithCounts = null) {
const methodOptions = ALL_METHODS.map((m) => {
const label = m === 'all' ? 'All Methods' : m;
return `${escapeHtml(label)} `;
}).join('');
const versionPills = listGames()
.map((g) => {
const isActive = g.id === game.id;
const cls = g.themeClass || (g.id === 'omega-ruby' ? 'version-or' : 'version-as');
return `
${escapeHtml(g.title)}
`;
})
.join('');
const profileList =
profilesWithCounts ||
(state.profiles || [{ id: 'default', name: 'Save 1', caughtCount: state.caught?.size || 0 }]);
const profileOptions = profileList
.map((p) => {
const countText = Number.isInteger(p.caughtCount) ? ` (${p.caughtCount})` : '';
return `${escapeHtml(p.name)}${escapeHtml(countText)} `;
})
.join('');
const rulesetSoloLabel =
game.id === 'omega-ruby' ? 'Strict Solo OR Cartridge' : 'Strict Solo AS Cartridge';
const rulesetAllLabel =
game.id === 'omega-ruby'
? 'Show All (incl. Trade / AS / Events)'
: 'Show All (incl. Trade / OR / Events)';
return `
`;
}