Build a small flight booker — the classic 7GUIs exercise. A dropdown chooses a one-way or return trip, and there are two date fields: departure and return. The two fields are linked: the return date is disabled for a one-way trip, and for a return trip you can't book a flight that comes back before it leaves. It's a compact lesson in dependent fields and cross-field validation — where one control's state changes what another can do.
// A self-contained component. No props.
function App(): JSX.Element;
A trip-type select, two date inputs, and a Book button that's enabled only when the selection is valid.
type = one-way → return date disabled; Book enabled
type = return, dep ≤ ret → both dates active; Book enabled
type = return, dep > ret → return field flagged; Book DISABLED
click Book → "Booked a return flight departing … returning …"
yyyy-mm-dd strings compare correctly with <, so:
'2026-07-01' < '2026-07-08' → valid return trip
yyyy-mm-dd) sort lexically, a plain ret < depart comparison works — no Date parsing needed.