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])
|
}, [link])
|
||||||
|
|
||||||
const getColor = (): ButtonColor => {
|
const getColor = (): ButtonColor => {
|
||||||
if (status === 200) {
|
switch (true) {
|
||||||
return 'primary'
|
case isLoading:
|
||||||
} else if (status === 404) {
|
return 'default'
|
||||||
return 'danger'
|
case status === 200:
|
||||||
} else {
|
return 'primary'
|
||||||
return 'default'
|
case status === 404:
|
||||||
|
return 'danger'
|
||||||
|
default:
|
||||||
|
return 'default'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +53,7 @@ const CustomButton: React.FC<ButtonProps> = ({ label, link }) => {
|
||||||
<Button
|
<Button
|
||||||
isDisabled={status !== 200 || !link || isLoading}
|
isDisabled={status !== 200 || !link || isLoading}
|
||||||
isLoading={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()}
|
color={getColor()}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue