headplane/app/routes/dns/components/rename-tailnet.tsx

49 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-12-31 10:30:14 +05:30
import Code from '~/components/Code';
import Dialog from '~/components/Dialog';
2025-01-28 16:02:47 -05:00
import Input from '~/components/Input';
2024-03-28 14:20:19 -04:00
interface Props {
name: string;
isDisabled: boolean;
}
2024-03-26 17:42:45 -04:00
export default function RenameTailnet({ name, isDisabled }: Props) {
2024-03-26 17:42:45 -04:00
return (
2025-01-28 16:02:47 -05:00
<div className="flex flex-col w-2/3 gap-y-4">
<h1 className="text-2xl font-medium mb-2">Tailnet Name</h1>
<p>
2024-12-31 10:30:14 +05:30
This is the base domain name of your Tailnet. Devices are accessible at{' '}
<Code>[device].{name}</Code> when Magic DNS is enabled.
2024-03-29 01:53:32 -04:00
</p>
<Input
2025-01-28 16:02:47 -05:00
isReadOnly
2025-02-04 11:42:57 -05:00
labelHidden
2025-01-28 16:02:47 -05:00
className="w-3/5 font-medium text-sm"
2025-02-04 11:42:57 -05:00
label="Tailnet name"
2024-03-29 01:53:32 -04:00
value={name}
2024-12-31 10:30:14 +05:30
onFocus={(event) => {
event.target.select();
2024-03-29 01:53:32 -04:00
}}
/>
2024-04-30 11:03:53 -04:00
<Dialog>
<Dialog.Button isDisabled={isDisabled}>Rename Tailnet</Dialog.Button>
<Dialog.Panel isDisabled={isDisabled}>
<Dialog.Title>Rename Tailnet</Dialog.Title>
<Dialog.Text className="mb-8">
Keep in mind that changing this can lead to all sorts of unexpected
behavior and may break existing devices in your tailnet.
</Dialog.Text>
<input type="hidden" name="action_id" value="rename_tailnet" />
2025-01-28 16:02:47 -05:00
<Input
isRequired
label="Tailnet name"
placeholder="ts.net"
defaultValue={name}
name="new_name"
/>
2024-04-30 11:03:53 -04:00
</Dialog.Panel>
</Dialog>
2024-03-29 01:53:32 -04:00
</div>
2024-12-31 10:30:14 +05:30
);
2024-03-26 17:42:45 -04:00
}