// Lalaluxe booking — booking/screens/length.jsx
// Page: "length" — nail length picker (finger preview = LengthStage in ui/choices.jsx).
// One screen per file. Load before app.jsx (see docs/architecture.md, "The no-build multi-file Babel contract").
function LengthStep({ cfg, s, set }) {
	const prices = cfg.base[s.service];
	const captions = cfg.content.lengthCaptions;

	return (
		<div className="screen">
			<ScreenHead cfg={cfg} screen="length">
				Choose Your <em>Length</em>
			</ScreenHead>

			<div className="body">
				<LengthStage
					value={s.length}
					caption={s.length ? captions[s.length] : ""}
					captionPlaceholder="Tap a length to try it on"
					priceFor={(L) => priceTag(prices[L])}
					onPick={(L) => set({ length: L })}
					labels={cfg.labels.length}
					options={orderedKeys(cfg.content.order?.length, prices || {}).filter((key) => key !== "flat" && Number.isFinite(prices[key]))}
				/>
			</div>
		</div>
	);
}
