import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@components/UI/Dialog.tsx"; import { Link } from "@components/UI/Typography/Link.tsx"; import { Checkbox } from "@components/UI/Checkbox/index.tsx"; import { Button } from "@components/UI/Button.tsx"; import { useDevice } from "@core/stores/deviceStore.ts"; import { useState } from "react"; import { eventBus } from "@core/utils/eventBus.ts"; export interface RouterRoleDialogProps { open: boolean; onOpenChange: (open: boolean) => void; } export const UnsafeRolesDialog = ({ open, onOpenChange }: RouterRoleDialogProps) => { const [confirmState, setConfirmState] = useState(false); const { setDialogOpen } = useDevice(); const deviceRoleLink = "https://meshtastic.org/docs/configuration/radio/device/"; const choosingTheRightDeviceRoleLink = "https://meshtastic.org/blog/choosing-the-right-device-role/"; const handleCloseDialog = (action: 'confirm' | 'dismiss') => { setDialogOpen('unsafeRoles', false); setConfirmState(false); eventBus.emit('dialog:unsafeRoles', { action }); } return ( handleCloseDialog('dismiss')} /> Are you sure? I have read the Device Role Documentation{" "} and the blog post about Choosing The Right Device Role and understand the implications of changing the role.
setConfirmState(!confirmState)} > Yes, I know what I'm doing
); };