import{a as x,j as t}from"./vendor-query-B2UbickB.js";import{c as d}from"./vendor-react-CXumBFUA.js";const u=20;function h(e,o=u){if(e.length<=o)return e;const r=Math.floor((o-1)/2);return`${e.slice(0,r)}…${e.slice(-r)}`}function j({label:e,value:o,href:r,external:c}){const[s,i]=x.useState(!1),l=d();if(!o)return null;const a=n=>{n.stopPropagation(),navigator.clipboard.writeText(o),i(!0),setTimeout(()=>i(!1),1500)},p=n=>{n.stopPropagation(),r&&(c?window.open(r,"_blank","noopener,noreferrer"):l(r))};return t.jsxs("div",{className:"text-left group relative",children:[t.jsx("span",{className:"text-[11px] font-medium text-text-secondary uppercase tracking-wide",children:e}),t.jsxs("span",{className:"flex items-center gap-1 mt-0.5",children:[t.jsx("button",{onClick:a,title:o,className:"text-[12px] font-mono text-text-primary group-hover:text-accent transition-colors",children:h(o)}),t.jsx("button",{onClick:a,title:"Copy",className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 p-0.5",children:t.jsx("svg",{className:`w-3 h-3 transition-colors ${s?"text-status-success":"text-text-tertiary hover:text-text-primary"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s?t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"}):t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 5H6a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2v-1M8 5a2 2 0 002 2h2a2 2 0 002-2M8 5a2 2 0 012-2h2a2 2 0 012 2m0 0h2a2 2 0 012 2v3"})})}),r&&t.jsx("button",{onClick:p,title:`View ${e}`,className:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 p-0.5",children:t.jsx("svg",{className:"w-3 h-3 text-text-tertiary hover:text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101M10.172 13.828a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})})})]})]})}export{j as C};
//# sourceMappingURL=CopyableId-DaT0ZRHg.js.map
