import { Dialog, DialogClose, DialogContent, DialogHeader, DialogTitle, } from "@components/UI/Dialog.tsx"; import { Button } from "@components/UI/Button.tsx"; import { LockKeyholeOpenIcon } from "lucide-react"; import { useRefreshKeysDialog } from "./useRefreshKeysDialog.ts"; import { useDevice } from "@core/stores/deviceStore.ts"; import { useMessageStore } from "@core/stores/messageStore.ts"; export interface RefreshKeysDialogProps { open: boolean; onOpenChange: (open: boolean) => void; } export const RefreshKeysDialog = ({ open, onOpenChange }: RefreshKeysDialogProps) => { const { activeChat } = useMessageStore(); const { nodeErrors, nodes } = useDevice(); const { handleCloseDialog, handleNodeRemove } = useRefreshKeysDialog(); const nodeErrorNum = nodeErrors.get(activeChat); if (!nodeErrorNum) { console.error("Node with error not found"); return null; } const nodeWithError = nodes.get(nodeErrorNum?.node ?? 0); if (!nodeWithError) { console.error("Node with error not found"); return null; } const text = { title: `Keys Mismatch - ${nodeWithError?.user?.longName ?? ""}`, description: `Your node is unable to send a direct message to node: ${nodeWithError?.user?.longName ?? ""} (${nodeWithError?.user?.shortName ?? ""}). This is due to the remote node's current public key does not match the previously stored key for this node.`, } return ( {text.title} {text.description}
  • Accept New Keys

    This will remove the node from device and request new keys.

{/* */}
); };