'use client'; import { useEffect, useState } from 'react'; interface WorldArtifact { id: string; title: string; node: string; type: 'world' | 'lore' | 'code'; timestamp: string; link: string; } const TYPE_COLORS: Record = { world: '#2979FF', lore: '#9C27B0', code: '#FF1D6C', }; const NODE_EMOJI: Record = { aria64: '🔴', alice: '🔵', }; export default function WorldsPage() { const [worlds, setWorlds] = useState([]); const [total, setTotal] = useState(0); const [loading, setLoading] = useState(true); const [filter, setFilter] = useState('all'); useEffect(() => { async function load() { try { const res = await fetch('/api/worlds?limit=60'); const data = await res.json(); setWorlds(data.worlds || []); setTotal(data.total || 0); } finally { setLoading(false); } } load(); const interval = setInterval(load, 60000); // refresh every 60s return () => clearInterval(interval); }, []); const filtered = filter === 'all' ? worlds : worlds.filter(w => w.type === filter || w.node === filter); return (

🌍 World Artifacts

{total} artifacts generated by the Pi fleet · auto-refreshes every 60s

RSS Feed ↗
{/* Filter pills */}
{['all', 'world', 'lore', 'code', 'aria64', 'alice'].map(f => ( ))}
{loading ? (
Loading worlds…
) : ( )} {!loading && filtered.length === 0 && (
No artifacts match this filter.
)}
); }