'use client'; import styles from '@components/ActionButton.module.css'; import * as React from 'react'; import * as Utilities from '@common/utilities'; interface ActionButtonProps { onClick?: () => void; hotkey?: any; children?: React.ReactNode; style?: any; rootStyle?: any; isSelected?: boolean; } const ActionButton = React.forwardRef(({ onClick, hotkey, children, style, rootStyle, isSelected }, ref) => { return (
{ if (e.key === 'Enter' || e.key === ' ') { if (e.key === ' ') e.preventDefault(); onClick?.(); } }} tabIndex={0} ref={ref} role="button"> {Utilities.isEmpty(hotkey) ? null : {hotkey}} {children}
); }); ActionButton.displayName = 'ActionButton'; export default ActionButton;