import { type FC, type KeyboardEventHandler, type ReactNode, useCallback, useId, useRef } from 'react'; import styles from './Radiobutton.module.css'; export interface RadiobuttonProps { checked: boolean, onChange: (checked: boolean) => void, children: ReactNode, } export const Radiobutton: FC = ({ checked, onChange, children }) => { const inputRef = useRef(null); const id = useId(); const labelOnKeyDown: KeyboardEventHandler = useCallback((e) => { if(e.key === 'Enter' || e.key === ' ') { inputRef.current?.click(); e.preventDefault(); } }, []); return (