import classnames from 'classnames' import * as React from 'react' import { TLUiTranslationKey } from '../../hooks/useTranslation/TLUiTranslationKey' import { useTranslation } from '../../hooks/useTranslation/useTranslation' import { TLUiIconType } from '../../icon-types' import { Spinner } from '../Spinner' import { Icon } from './Icon' import { Kbd } from './Kbd' /** @public */ export interface TLUiButtonProps extends React.HTMLAttributes { loading?: boolean // TODO: loading spinner disabled?: boolean label?: TLUiTranslationKey | Exclude icon?: TLUiIconType | Exclude spinner?: boolean iconLeft?: TLUiIconType | Exclude smallIcon?: boolean kbd?: string isChecked?: boolean invertIcon?: boolean type: 'normal' | 'primary' | 'danger' | 'low' | 'icon' | 'tool' | 'menu' | 'help' } /** @public */ export const Button = React.forwardRef(function Button( { label, icon, invertIcon, iconLeft, smallIcon, kbd, isChecked = false, type, children, spinner, ...props }, ref ) { const msg = useTranslation() const labelStr = label ? msg(label) : '' return ( ) })