feat: add loading states
This commit is contained in:
parent
cc1427882f
commit
935e015be9
5 changed files with 86 additions and 42 deletions
|
|
@ -4,6 +4,7 @@ import clsx from 'clsx'
|
|||
import { useState } from 'react'
|
||||
|
||||
import Button from '~/components/Button'
|
||||
import Spinner from '~/components/Spinner'
|
||||
|
||||
type Properties = {
|
||||
readonly isEnabled: boolean;
|
||||
|
|
@ -25,6 +26,9 @@ export default function Modal({ isEnabled, disabled }: Properties) {
|
|||
setIsOpen(true)
|
||||
}}
|
||||
>
|
||||
{fetcher.state === 'idle' ? undefined : (
|
||||
<Spinner className='w-3 h-3'/>
|
||||
)}
|
||||
{isEnabled ? 'Disable' : 'Enable'} Magic DNS
|
||||
</Button>
|
||||
<Dialog
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue