/* eslint-disable @typescript-eslint/naming-convention */ /* eslint-disable unicorn/no-keyword-prefix */ import { useFetcher } from '@remix-run/react' import { useState } from 'react' import Button from '~/components/Button' import Code from '~/components/Code' import Input from '~/components/Input' import useModal from '~/components/Modal' import Spinner from '~/components/Spinner' 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() const { Modal, open } = useModal({ title: 'Rename Tailnet', description: 'Keep in mind that changing this can lead to all sorts of unexpected behavior and may break existing devices in your tailnet.', buttonText: 'Rename', children: ( { setNewName(event.target.value) }} /> ), onConfirm: () => { fetcher.submit({ 'dns_config.base_domain': newName }, { method: 'PATCH', encType: 'application/json' }) } }) return (
This is the base domain name of your Tailnet.
Devices are accessible at
{' '}
[device].[user].{name}
{' '}
when Magic DNS is enabled.