const BOX = { width: 92, height: 42, radius: 10 }; const GAP = 40; const PAD = 4; const WIDTH = BOX.width * 3 + GAP * 2 + PAD * 2; const HEIGHT = BOX.height + PAD * 2; const MONO = "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"; const CHAINS = { acme: [ { label: "Visitor", port: "https" }, { label: "frislit", port: ":443", accent: true }, ], proxy: [ { label: "Visitor", port: "https" }, { label: "nginx", port: ":443" }, { label: "frislit", port: ":8080", accent: true }, ], }; export const TlsDiagram = ({ mode }) => { const chain = CHAINS[mode] || CHAINS.proxy; const span = chain.length * BOX.width + (chain.length - 1) * GAP; const left = (WIDTH - span) / 2; return ( {chain.map((node, index) => { const x = left + index * (BOX.width + GAP); return ( {node.label} {node.port} {index < chain.length - 1 && ( )} ); })} ); };