import React, { forwardRef, memo, useCallback, type Ref } from 'react'; import { useRefFrom } from 'use-ref-from'; import { type DTMF } from '../types'; import styles from './Button.module.css'; import { useStyles } from '../../../styles'; type Props = Readonly<{ button: DTMF; ['data-testid']?: string | undefined; onClick?: (() => void) | undefined; ruby?: string | undefined; }>; const Button = memo( forwardRef(({ button, 'data-testid': dataTestId, onClick, ruby }: Props, ref: Ref) => { const classNames = useStyles(styles); const onClickRef = useRefFrom(onClick); const handleClick = useCallback(() => onClickRef.current?.(), [onClickRef]); return ( ); }) ); Button.displayName = 'TelephoneKeypad.Button'; export default Button;