mirror of
https://github.com/ershisan99/flashcards-example-project.git
synced 2025-12-25 12:33:49 +00:00
chore: update deps, apply updated eslint ocnfig
This commit is contained in:
@@ -5,13 +5,13 @@ import s from './button.module.scss'
|
||||
export type ButtonProps<T extends ElementType = 'button'> = {
|
||||
as?: T
|
||||
children: ReactNode
|
||||
variant?: 'primary' | 'secondary' | 'tertiary' | 'link' | 'icon'
|
||||
fullWidth?: boolean
|
||||
className?: string
|
||||
fullWidth?: boolean
|
||||
variant?: 'icon' | 'link' | 'primary' | 'secondary' | 'tertiary'
|
||||
} & ComponentPropsWithoutRef<T>
|
||||
|
||||
export const Button = <T extends ElementType = 'button'>(props: ButtonProps<T>) => {
|
||||
const { variant = 'primary', fullWidth, className, as: Component = 'button', ...rest } = props
|
||||
const { as: Component = 'button', className, fullWidth, variant = 'primary', ...rest } = props
|
||||
|
||||
return (
|
||||
<Component className={`${s[variant]} ${fullWidth ? s.fullWidth : ''} ${className}`} {...rest} />
|
||||
|
||||
Reference in New Issue
Block a user