import { useFetcher } from 'react-router'; import type { PreAuthKey } from '~/types'; import { cn } from '~/utils/cn'; import Dialog from '~/components/Dialog'; import Spinner from '~/components/Spinner'; interface Props { authKey: PreAuthKey; } export default function ExpireKey({ authKey }: Props) { const fetcher = useFetcher(); return ( Expire Key {(close) => ( <> Expire auth key? { fetcher.submit(e.currentTarget); close(); }} > Expiring this authentication key will immediately prevent it from being used to authenticate new devices. This action cannot be undone.
Cancel {fetcher.state === 'idle' ? undefined : ( )} Expire
)}
); }