export function keyboardClickHandler(onClick: () => void) { function onKeyDown(e: React.KeyboardEvent) { if (e.key === "Enter" || e.key === " ") { onClick(); } } return onKeyDown; }