1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

refactor main components and IProps

This commit is contained in:
Fedor Katurov 2023-11-22 19:59:17 +06:00
parent 85a182c053
commit efbaf13151
124 changed files with 235 additions and 256 deletions

View file

@ -8,13 +8,13 @@ import styles from './styles.module.scss';
type ToggleColor = 'primary' | 'secondary' | 'lab' | 'danger' | 'white';
type IProps = Omit<ButtonProps, 'value' | 'color'> & {
type Props = Omit<ButtonProps, 'value' | 'color'> & {
value?: boolean;
handler?: (val: boolean) => void;
color?: ToggleColor;
};
const Toggle: FC<IProps> = ({ value, handler, color = 'primary', ...rest }) => {
const Toggle: FC<Props> = ({ value, handler, color = 'primary', ...rest }) => {
const onClick = useCallback(() => {
if (!handler) {
return;