import {
ButtonHTMLAttributes,
ComponentPropsWithoutRef,
ElementType,
ForwardedRef,
forwardRef,
} from 'react';
import classnames from 'classnames';
import { Icon } from './Icon';
export interface ButtonProps
extends ButtonHTMLAttributes {
color?: 'primary' | 'secondary';
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 && }
);
});