diff --git a/src/components/Buttons.tsx b/src/components/Buttons.tsx index 8e4f828..8a66db5 100644 --- a/src/components/Buttons.tsx +++ b/src/components/Buttons.tsx @@ -29,12 +29,15 @@ const CustomButton: React.FC = ({ label, link }) => { }, [link]) const getColor = (): ButtonColor => { - if (status === 200) { - return 'primary' - } else if (status === 404) { - return 'danger' - } else { - return 'default' + switch (true) { + case isLoading: + return 'default' + case status === 200: + return 'primary' + case status === 404: + return 'danger' + default: + return 'default' } } @@ -50,7 +53,7 @@ const CustomButton: React.FC = ({ label, link }) => {