import classnames from 'classnames'; import type { ButtonHTMLAttributes, ComponentPropsWithoutRef, ElementType, ForwardedRef, } from 'react'; import { forwardRef } from 'react'; import { Icon } from './Icon'; export interface ButtonProps extends ButtonHTMLAttributes { color?: 'primary' | 'secondary' | 'warning' | 'danger'; size?: 'xs' | 'sm' | 'md'; justify?: 'start' | 'center'; forDropdown?: boolean; as?: T; } export const Button = forwardRef(function Button( { className, as, justify = 'center', children, size = 'md', forDropdown, color, ...props }: ButtonProps & Omit, keyof ButtonProps>, ref: ForwardedRef, ) { const Component = as || 'button'; return ( {children} {forDropdown && } ); });