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

Your Genlockes

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

No genlockes yet. Start your first Generation Locke!

Start New Genlocke
)} {genlockes && genlockes.length > 0 && (
{genlockes.map((g) => (

{g.name}

{g.currentLegOrder !== null ? `Leg ${g.currentLegOrder} / ${g.totalLegs}` : `${g.completedLegs} / ${g.totalLegs} legs completed`} {' \u00b7 '} Started{' '} {new Date(g.createdAt).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric', })}

{g.status}
))}
)}
) }