/* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable unicorn/no-keyword-prefix */ import { useFetcher } from '@remix-run/react' import { useState } from 'react' import { Input } from 'react-aria-components' import Code from '~/components/Code' import Dialog from '~/components/Dialog' import Spinner from '~/components/Spinner' import TextField from '~/components/TextField' import { cn } from '~/utils/cn' type Properties = { readonly name: string; // eslint-disable-next-line react/boolean-prop-naming readonly disabled?: boolean; } export default function Modal({ name, disabled }: Properties) { const [newName, setNewName] = useState(name) const fetcher = useFetcher() return (

Tailnet Name

This is the base domain name of your Tailnet. Devices are accessible at {' '} [device].{name} {' '} when Magic DNS is enabled.

{ event.target.select() }} /> {fetcher.state === 'idle' ? undefined : ( )} Rename Tailnet {close => ( <> Rename Tailnet Keep in mind that changing this can lead to all sorts of unexpected behavior and may break existing devices in your tailnet.
Cancel { fetcher.submit({ 'dns.base_domain': newName }, { method: 'PATCH', encType: 'application/json' }) close() }} > Rename
)}
) }