feat: add loading states

This commit is contained in:
Aarnav Tale 2024-03-30 04:12:37 -04:00
parent cc1427882f
commit 935e015be9
No known key found for this signature in database
5 changed files with 86 additions and 42 deletions

View file

@ -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