mirror of
https://github.com/skidoodle/erettsegi-browser.git
synced 2025-02-15 05:39:15 +01:00
xd
This commit is contained in:
parent
603a32b067
commit
5e46ceb833
1 changed files with 10 additions and 7 deletions
|
@ -29,12 +29,15 @@ const CustomButton: React.FC<ButtonProps> = ({ 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<ButtonProps> = ({ label, link }) => {
|
|||
<Button
|
||||
isDisabled={status !== 200 || !link || isLoading}
|
||||
isLoading={isLoading}
|
||||
className='w-24 mt-3 text-sm font-bold py-2 px-2'
|
||||
className='w-28 mt-3 text-sm font-bold py-2 px-2'
|
||||
color={getColor()}
|
||||
onClick={handleClick}
|
||||
>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue