"use client"; import { useState } from "react"; import { Panel } from "./Panel"; /* * A licence blob is signed public data, not a secret — it is useless on any * instance other than the one it names. So it is safe to show inline, and * showing it is what stops a blocked download from blocking a paying customer. * That is also why it is never collapsed behind a toggle: someone whose * clipboard and download are both blocked has to be able to select it by hand. * * It is evidence rather than content, so it is set in a well with a keyed strip * saying what it is and how much of it there is, and given a fixed height. It * used to run to 250px of base64 and was the largest thing on the page, which * is a strange amount of room to give a string nobody reads. * * The download lives in the page header beside Renew, not here — it was in both * places, which is one button too many for one file. */ export function LicenceDelivery({ blob }: { instanceId: string; blob: string; downloadUrl: string }) { const [copied, setCopied] = useState(false); async function copy() { try { await navigator.clipboard.writeText(blob); setCopied(true); setTimeout(() => setCopied(false), 2000); } catch { // Clipboard is refused without a secure context or a gesture the // browser trusts. The blob is on screen and selectable either way, // so this needs no error state. } } const steps = [ <> Open Settings → Licence on your install. , <>Paste the licence into the box and save., <> The page reports Valid straight away — no restart. , ]; return (
Licence key {blob.length.toLocaleString()} characters
{/* Dashed, because this is data to be carried somewhere else rather than a surface to read. */}
                        {blob}
                    
{/* Numbered because this is an actual sequence — each step is only possible once the one before it is done. */}
    {steps.map((body, i) => (
  1. {i + 1} {body}
  2. ))}
); } function Code({ children }: { children: React.ReactNode }) { return {children}; }