import classnames from 'classnames'; import { type MouseEventHandler, type PropsWithChildren } from 'react'; import { prevent } from '../../../utils/dom'; import { isElement } from '../../../utils/is-element'; import { slottableComponent } from '../HOC/slottableComponent'; type Props = PropsWithChildren<{ onClick?: MouseEventHandler; className?: string; disabled?: boolean; label?: string; value?: string; type?: 'button' | 'submit' | 'reset'; selected?: boolean; readOnly?: boolean; id?: string; }>; function LunaticButton({ id, children, onClick, disabled, label, className, value, type = 'button', selected, readOnly, }: Props) { const handleClick = prevent(onClick); if (isElement(children) || value) return ( ); return ( ); } export const Button = slottableComponent('Button', LunaticButton);