import { Button } from "@components/UI/Button.tsx"; import { Dialog, DialogClose, DialogContent, DialogHeader, DialogTitle, } from "@components/UI/Dialog.tsx"; import { useMessages, useNodeDB } from "@core/stores"; import { LockKeyholeOpenIcon } from "lucide-react"; import { useTranslation } from "react-i18next"; import { useRefreshKeysDialog } from "./useRefreshKeysDialog.ts"; export interface RefreshKeysDialogProps { open: boolean; onOpenChange: (open: boolean) => void; } export const RefreshKeysDialog = ({ open, onOpenChange, }: RefreshKeysDialogProps) => { const { t } = useTranslation("dialog"); const { activeChat } = useMessages(); const { nodeErrors, getNode } = useNodeDB(); const { handleCloseDialog, handleNodeRemove } = useRefreshKeysDialog(); const nodeErrorNum = nodeErrors.get(activeChat); if (!nodeErrorNum) { return null; } const nodeWithError = getNode(nodeErrorNum.node); const text = { title: t("refreshKeys.title", { interpolation: { escapeValue: false }, identifier: nodeWithError?.user?.longName ?? "", }), description: `${t("refreshKeys.description.unableToSendDmPrefix")}${ nodeWithError?.user?.longName ?? "" } (${nodeWithError?.user?.shortName ?? ""})${t( "refreshKeys.description.keyMismatchReasonSuffix", )}`, }; return ( {text.title} {text.description}
  • {t("refreshKeys.label.acceptNewKeys")}

    {t("refreshKeys.description.acceptNewKeys")}

); };