diff --git a/components/shared/ui/CustomButton/CustomButton.tsx b/components/shared/ui/CustomButton/CustomButton.tsx index 5a473df..a508cdb 100644 --- a/components/shared/ui/CustomButton/CustomButton.tsx +++ b/components/shared/ui/CustomButton/CustomButton.tsx @@ -1,20 +1,30 @@ -import { CustomButtonProps } from './CustomButtonProps'; +import { ICustomButtonProps } from './CustomButtonProps'; import styles from './CustomButton.module.scss'; import cn from 'classnames'; import Link from 'next/link'; +import { FC } from 'react'; -export const CustomButton = (props: CustomButtonProps) => { - const { disabled, size, color, radius, text, image, imagePosition, link, imageSize } = props; +export const CustomButton: FC = ({ + size, + color, + radius, + text, + image, + imagePosition, + link, + imageSize, + ...rest +}) => { const buttonClasses = cn( styles.button, styles[`size-${size}`], styles[`color-${color}`], styles[`radius-${radius}`], + rest.disabled ? styles.disabled : null, { [styles['text-center']]: imagePosition === 'left' || imagePosition === 'right', }, - props.disabled ? styles.disabled : null, ); const imageStyles = { @@ -39,7 +49,7 @@ export const CustomButton = (props: CustomButtonProps) => { } return ( -