import { ComponentPropsWithoutRef, ElementRef, ElementType, ForwardedRef, ReactNode, forwardRef, } from 'react' import { clsx } from 'clsx' import s from './button.module.scss' export type ButtonProps = { as?: T children: ReactNode className?: string fullWidth?: boolean variant?: 'icon' | 'link' | 'primary' | 'secondary' | 'tertiary' } & ComponentPropsWithoutRef const ButtonPolymorph = (props: ButtonProps, ref: any) => { const { as: Component = 'button', className, fullWidth, rounded, variant = 'primary', ...rest } = props return ( ) } export const Button = forwardRef(ButtonPolymorph) as ( props: ButtonProps & Omit, keyof ButtonProps> & { ref?: ForwardedRef> } ) => ReturnType