import { AriaAttributes, ComponentType, forwardRef, MouseEventHandler, PropsWithChildren, ReactNode, } from 'react'; import clsx from 'clsx'; import { AutomationTestingProps } from '@/types'; import { Icon } from '@@/Icon'; import './Button.css'; type Type = 'submit' | 'button' | 'reset'; type Color = | 'default' | 'primary' | 'secondary' | 'danger' | 'link' | 'light' | 'dangerlight' | 'warninglight' | 'warning' | 'none'; type Size = 'xsmall' | 'small' | 'medium' | 'large'; export interface Props extends AriaAttributes, AutomationTestingProps { icon?: ReactNode | ComponentType; color?: Color; size?: Size; disabled?: boolean; title?: string; className?: string; type?: Type; as?: ComponentType | string; onClick?: MouseEventHandler; mRef?: React.ForwardedRef; props?: TasProps; } export const ButtonWithRef = forwardRef>( (props, ref) => ( // eslint-disable-next-line react/jsx-props-no-spreading