/
dedaMazai
/
paket
Обзор
Документация
Войти
/
dedaMazai
/
paket
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/ui/CustomButton/CustomButton.tsx
40 строк
943 B
Andrey Chipizubov
fix
15 авг 2023, 12:42
15 авг 2023, 12:42
01f0bd7
Код
Авторство
О чём код?
import { memo, ReactNode } from 'react'; import Button, { ButtonProps } from 'antd/es/button'; import { classNames, Mods } from '@/lib/classNames/classNames'; import cls from './CustomButton.module.scss'; export interface CustomButtonProps extends ButtonProps { className?: string; square?: boolean; disabled?: boolean; children?: ReactNode; fullWidth?: boolean; } export const CustomButton = memo((props: CustomButtonProps) => { const { className, children, square, disabled, fullWidth, ...otherProps } = props; const mods: Mods = { [cls.square]: square, [cls.disabled]: disabled, [cls.fullWidth]: fullWidth, }; return ( <Button className={classNames(cls.Button, mods, [className])} {...otherProps} disabled={disabled} > {children} </Button> ); });