import { Link } from 'react-router-dom' import { useRuns } from '../hooks/useRuns' import type { RunStatus } from '../types' const statusStyles: Record = { active: 'bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300', completed: 'bg-blue-100 text-blue-800 dark:bg-blue-900/40 dark:text-blue-300', failed: 'bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300', } export function RunList() { const { data: runs, isLoading, error } = useRuns() return (

Your Runs

Start New Run
{isLoading && (
)} {error && (
Failed to load runs. Please try again.
)} {runs && runs.length === 0 && (

No runs yet. Start your first Nuzlocke!

Start New Run
)} {runs && runs.length > 0 && (
{runs.map((run) => (

{run.name}

Started{' '} {new Date(run.startedAt).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric', })}

{run.status}
))}
)}
) }