import { useState } from 'react'; import { Input } from 'react-aria-components'; import { useFetcher } from 'react-router'; 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; readonly disabled?: boolean; }; // TODO: Switch to form submit instead of JSON patch 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 { fetcher.submit( { 'dns.base_domain': newName, }, { method: 'PATCH', encType: 'application/json', }, ); }} > Rename Tailnet Keep in mind that changing this can lead to all sorts of unexpected behavior and may break existing devices in your tailnet.
); }