import { Link } from 'react-router-dom' import PublicLayout from '../../components/PublicLayout.jsx' import PageHeader from '../../components/PageHeader.jsx' import { Loading, ErrorState, EmptyState } from '../../components/PageState.jsx' import { useAsync } from '../../lib/useAsync.js' import { api } from '../../api/client.js' const ROMAN = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII'] // Short blurbs for the seeded categories (the list endpoint returns title/slug only). const BLURBS = { 'new-player-guide': 'First steps, basic survival, and early goals.', 'maps-atlas': 'Regions, towns, routes, and travel notes.', systems: 'Shard mechanics and custom features.', items: 'Equipment, treasures, rewards, and curiosities.', monsters: 'Creatures, bosses, spawns, and dangers.', crafting: 'Professions, materials, recipes, and tools.', lore: 'Stories, places, factions, and mysteries.', rules: 'Player conduct, shard expectations, and policies.', } export default function Wiki() { const { loading, error, data } = useAsync(() => api.wiki()) const pages = data || [] return (
{loading && } {error && } {!loading && !error && pages.length === 0 && No wiki pages yet.}
{pages.map((p, i) => ( {ROMAN[i] || i + 1}

{p.title}

{BLURBS[p.slug] || 'Open the guide →'}

))}
) }