"use client"; import { useTranslations } from "next-intl"; import { useEffect } from "react"; import { THREEMA_GATEWAY } from "@/lib/threema-gateway-config"; interface ThreemaQrModalProps { open: boolean; onClose: () => void; } /** * On-demand modal showing the QR for adding the assistant on Threema. * Triggered by the "Show QR" button in the threema channel card and * closes on overlay click, ESC, or the close button. * * Uses a plain not next/image — image optimization adds nothing * for a 57KB static PNG and removes a potential source of rendering * bugs in the Next.js standalone build. */ export function ThreemaQrModal({ open, onClose }: ThreemaQrModalProps) { const t = useTranslations("channelUsers.threemaSetup"); useEffect(() => { if (!open) return; function onKey(e: KeyboardEvent) { if (e.key === "Escape") onClose(); } window.addEventListener("keydown", onKey); return () => window.removeEventListener("keydown", onKey); }, [open, onClose]); if (!open) return null; return (
e.stopPropagation()} className="w-full max-w-md bg-surface-1 border border-border rounded-2xl p-6 shadow-2xl shadow-black/40 space-y-4" >

{t("title")}

{/* eslint-disable-next-line @next/next/no-img-element */} {t("qrAlt",

{THREEMA_GATEWAY.displayName}

  1. {t("step1")}
  2. {t("step2")}
  3. {t("step3")}
); }