2025-03-17 10:46:31 -04:00
|
|
|
import { useNavigate } from 'react-router';
|
2024-12-31 10:30:14 +05:30
|
|
|
import Dialog from '~/components/Dialog';
|
2024-12-31 10:31:50 +05:30
|
|
|
import type { Machine } from '~/types';
|
2024-04-29 20:31:29 -04:00
|
|
|
|
2024-06-02 01:33:40 -04:00
|
|
|
interface DeleteProps {
|
2025-01-26 15:04:13 -05:00
|
|
|
machine: Machine;
|
|
|
|
|
isOpen: boolean;
|
|
|
|
|
setIsOpen: (isOpen: boolean) => void;
|
2024-04-29 20:31:29 -04:00
|
|
|
}
|
|
|
|
|
|
2025-01-26 15:04:13 -05:00
|
|
|
export default function Delete({ machine, isOpen, setIsOpen }: DeleteProps) {
|
2025-03-17 10:46:31 -04:00
|
|
|
const navigate = useNavigate();
|
|
|
|
|
|
2024-04-29 20:31:29 -04:00
|
|
|
return (
|
2025-01-26 15:04:13 -05:00
|
|
|
<Dialog isOpen={isOpen} onOpenChange={setIsOpen}>
|
2025-03-17 10:46:31 -04:00
|
|
|
<Dialog.Panel
|
|
|
|
|
variant="destructive"
|
|
|
|
|
onSubmit={() => navigate('/machines')}
|
|
|
|
|
>
|
2025-01-26 15:04:13 -05:00
|
|
|
<Dialog.Title>Remove {machine.givenName}</Dialog.Title>
|
|
|
|
|
<Dialog.Text>
|
|
|
|
|
This machine will be permanently removed from your network. To re-add
|
|
|
|
|
it, you will need to reauthenticate to your tailnet from the device.
|
|
|
|
|
</Dialog.Text>
|
2025-04-16 01:48:38 -04:00
|
|
|
<input type="hidden" name="action_id" value="delete" />
|
|
|
|
|
<input type="hidden" name="node_id" value={machine.id} />
|
2024-04-29 20:31:29 -04:00
|
|
|
</Dialog.Panel>
|
|
|
|
|
</Dialog>
|
2024-12-31 10:30:14 +05:30
|
|
|
);
|
2024-04-29 20:31:29 -04:00
|
|
|
}
|