diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index 8b65913..07de8aa 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -1,4 +1,3 @@ -import React from 'react' import './button.scss' export enum ButtonType { @@ -7,18 +6,28 @@ export enum ButtonType { } interface IButton { - label: string + label?: string onClick?: () => void buttonType: ButtonType - Icon: JSX.Element + Icon?: JSX.Element } const Button = ({ label, onClick, buttonType, Icon }: IButton) => { + const getIconClassName = (): '' | ' with-icon' => { + return Icon ? ' with-icon' : '' + } + + const getLabelClassName = (): '' | ' with-label' => { + return label ? ' with-label' : '' + } + + const getPrimaryClassName = (): string => { + return ButtonType[buttonType ? buttonType : ButtonType.Primary] + } + return (