/
LOVEEEEER
/
TEST-SBER
Обзор
Документация
Войти
/
LOVEEEEER
/
TEST-SBER
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/components/shared/Button/Button.tsx
32 строки
712 B
Nikita Demyanenko
feat: upgrade poster items
08 авг 2024, 21:21
08 авг 2024, 21:21
333ae7a
Код
Авторство
О чём код?
import { ButtonHTMLAttributes, memo } from "react"; import cls from './Button.module.scss'; import classNames from "classnames"; type ButtonSizes = 'small' | "big"; type ButtonThemes = 'outlined' | 'contained'; interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> { className?: string; theme?: ButtonThemes; size?: ButtonSizes } export const Button = memo((props: ButtonProps) => { const { className, children, type, size = 'big', theme = 'contained', ...rest } = props; return ( <button className={classNames(cls.Button, className, cls[theme], cls[size])} type={type || 'button'} {...rest} > {children} </button> ) })