import { useEffect, useState } from 'react' import { Link } from 'react-router-dom' import { l1Api } from '@/api/l1' import type { WalkSession } from '@/types/l1' export function ResumeInProgress() { const [sessions, setSessions] = useState(null) useEffect(() => { l1Api .listActiveSessions() .then(setSessions) .catch(() => setSessions([])) }, []) if (!sessions || sessions.length === 0) return null return (
Resume in progress · {sessions.length}
{sessions.map((s) => (
#{s.id.slice(0, 8)} {s.session_kind === 'adhoc' ? `Ad-hoc · ${s.walk_notes.length} notes` : `Step ${s.walked_path.length}`}
{new Date(s.last_step_at).toLocaleTimeString()} ))}
) }