// buglens-components.jsx
// Shared primitives: logo, severity badge, buttons, copy action, tag.
function Logo({ size = 26 }) {
// Aperture / lens mark — the "lens" that inspects the bug.
return (
);
}
function Wordmark({ size = 26 }) {
return (
BugLens
);
}
function SeverityBadge({ level }) {
const s = SEVERITY[level] || SEVERITY.medium;
return (
{s.label}
);
}
function Btn({ children, kind = "ghost", onClick, icon, full, ...rest }) {
return (
);
}
function Tag({ children, tone = "neutral" }) {
return {children};
}
// Copy-to-clipboard with a transient "Copied" state.
function CopyBtn({ getText, label = "Copy" }) {
const [done, setDone] = React.useState(false);
const onCopy = () => {
try {
const txt = typeof getText === "function" ? getText() : String(getText || "");
if (navigator.clipboard) navigator.clipboard.writeText(txt).catch(() => {});
} catch (e) {}
setDone(true);
setTimeout(() => setDone(false), 1400);
};
return (
);
}
Object.assign(window, { Logo, Wordmark, SeverityBadge, Btn, Tag, CopyBtn });