import { HStack } from "@yaakapp-internal/ui"; import { useState } from "react"; import { showDialog } from "../lib/dialog"; import { CopyButton } from "./CopyButton"; import { IconButton } from "./core/IconButton"; /** * How much of the value to render at once. Rendering the whole thing would hit exactly the * layout cost this dialog exists to avoid, so it pages instead. */ const PAGE_CHARS = 20_000; interface Props { value: string; } export function LargeValueDialog({ value }: Props) { const [page, setPage] = useState(0); const pageCount = Math.max(1, Math.ceil(value.length / PAGE_CHARS)); const start = page * PAGE_CHARS; const slice = value.slice(start, start + PAGE_CHARS); return (