import type { ProxyLock } from "@yaakapp-internal/proxy-lib"; import { Button, Icon, LoadingIcon } from "@yaakapp-internal/ui"; import { useAtomValue } from "jotai"; import { useRpcMutation } from "../hooks/useRpcMutation"; import { encryptingPercent } from "../lib/encrypting"; import { lockedLine } from "../lib/locked"; import { proxyStateAtom } from "../lib/store"; import { getOsType } from "../lib/tauri"; /** * Over the list and the detail pane while captured traffic can't be read: its key is * unavailable, or traffic from before encryption is being encrypted. Retry reads the key again * and opens it. */ export function LockedState({ lock }: { lock: ProxyLock }) { const proxyState = useAtomValue(proxyStateAtom); const retry = useRpcMutation("take_over"); const encrypting = encryptingPercent(proxyState); return (