make the catchup card collapsable
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-06-26 09:45:10 +01:00
parent 3b37368e7d
commit e3bb654cbc

View File

@@ -1,5 +1,6 @@
"use client"; "use client";
import { useState } from "react";
import { formatDisplayDate } from "@/lib/dates-client"; import { formatDisplayDate } from "@/lib/dates-client";
type Gap = { date: string; reason: string }; type Gap = { date: string; reason: string };
@@ -16,11 +17,21 @@ const REASON_LABEL: Record<string, string> = {
}; };
export function CatchUpCard({ gaps, onSelectDate }: CatchUpCardProps) { export function CatchUpCard({ gaps, onSelectDate }: CatchUpCardProps) {
const [open, setOpen] = useState(false);
if (gaps.length === 0) return null; if (gaps.length === 0) return null;
return ( return (
<div className="retro-window mb-4"> <div className="retro-window mb-4">
<div className="retro-titlebar">Catch up gently</div> <button
type="button"
className="retro-titlebar w-full text-left"
aria-expanded={open}
onClick={() => setOpen(!open)}
>
Catch up ({gaps.length}) {open ? "▼" : "▶"}
</button>
{open && (
<div className="p-3 space-y-2"> <div className="p-3 space-y-2">
<p className="text-xs text-[var(--warm-grey)]"> <p className="text-xs text-[var(--warm-grey)]">
A few recent days could use a note no pressure, just pick one if you like. A few recent days could use a note no pressure, just pick one if you like.
@@ -37,6 +48,7 @@ export function CatchUpCard({ gaps, onSelectDate }: CatchUpCardProps) {
</button> </button>
))} ))}
</div> </div>
)}
</div> </div>
); );
} }