76 lines
21 KiB
JavaScript
76 lines
21 KiB
JavaScript
import{a as i,c as J,j as e}from"./vendor-react-Dkpvlwai.js";import{g as X,d as E,B as x,l as S,i as N,S as y,n as W,E as Y,C as L,b as q,c as Q,e as Z,k as ee}from"./index-VJPzCABl.js";import{S as _}from"./StatCard-DSHXVTeQ.js";import{I as se}from"./input-vC0DbxH_.js";import{u as M}from"./useCopyToClipboard-BsHfBITc.js";import{au as A,X as te,i as U,e as G,L as re,a as ae,R as oe,be as ne,ae as le,b1 as $,b8 as ie,aG as ce,aF as de,T as z}from"./vendor-icons-CbmLcMl-.js";import{w as ue}from"./webhookService-Cdsd96ab.js";import{T as ge,a as me,b as F,c as O}from"./Tabs-DPskxOgb.js";import{X as xe}from"./vendor-CAoAb3tF.js";import"./vendor-router-4bycex72.js";import"./vendor-tanstack-BoI3DtL9.js";import"./vendor-utils-CDFfoeXY.js";import"./AnimatedNumber-Bn2Qf9FV.js";const he=[{id:"user.read",label:"Read User Data"},{id:"user.write",label:"Update User Profile"},{id:"tracks.read",label:"Read Tracks"},{id:"tracks.upload",label:"Upload Tracks"},{id:"sales.read",label:"Read Sales Data"}],fe=({onClose:s,onCreate:c})=>{const n=X(),[a,m]=i.useState(1),[u,h]=i.useState(""),[l,b]=i.useState(["user.read"]),[f,v]=i.useState(""),[o,g]=i.useState(!1),[p,I]=i.useState(!1),j=i.useRef(null),{copied:D,copy:R}=M(),P=i.useCallback(()=>{if(typeof window>"u"||!j.current)return;const r=document.createRange();r.selectNodeContents(j.current),window.getSelection()?.removeAllRanges(),window.getSelection()?.addRange(r)},[]);i.useEffect(()=>(I(!0),()=>I(!1)),[]);const t=r=>{b(w=>w.includes(r)?w.filter(K=>K!==r):[...w,r])},d=async r=>{if(r?.preventDefault(),r?.stopPropagation(),!u.trim()){n.error("Please enter a name for your API key");return}if(l.length===0){n.error("Please select at least one permission scope");return}g(!0);try{const w=await c({name:u.trim(),scopes:l}),K=w?.key??w?.api_key;if(K)v(K);else{const H=`vz_${Math.random().toString(36).substr(2,8)}_${Math.random().toString(36).substr(2,16)}`;v(H)}m(2),g(!1)}catch(w){throw g(!1),w}},V=async r=>{if(r?.preventDefault(),r?.stopPropagation(),!f)return;await R(f)?n.success("API Key copied to clipboard"):n.error("Copy failed. Select the key above and copy manually (Ctrl+C).")};return p?J.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",style:{zIndex:9999},children:[e.jsx("div",{className:"absolute inset-0 bg-background/90 backdrop-blur-md",onClick:a===1?s:void 0}),e.jsxs("div",{className:"relative w-full max-w-2xl bg-card border border-border rounded-xl shadow-2xl animate-scaleIn overflow-hidden glass-hud flex flex-col max-h-layout-modal",children:[e.jsxs("div",{className:"p-6 border-b border-border/50 flex justify-between items-center bg-foreground/5 flex-none z-10",children:[e.jsxs("h3",{className:"text-xl font-bold text-foreground flex items-center gap-3 font-display",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-warning/20 flex items-center justify-center border border-warning/30",children:e.jsx(A,{className:"w-5 h-5 text-warning"})}),a===1?"Create API Key":"API Key Generated"]}),e.jsx("button",{onClick:s,className:"p-2 hover:bg-foreground/10 rounded-lg transition-colors",children:e.jsx(te,{className:"w-5 h-5 text-muted-foreground hover:text-foreground"})})]}),e.jsx("div",{className:"p-8 overflow-y-auto custom-scrollbar flex-1 relative",children:a===1?e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-muted-foreground uppercase tracking-wider mb-3",children:"Key Name"}),e.jsx(se,{placeholder:"e.g. Production Server, Mobile App",value:u,onChange:r=>h(r.target.value),autoFocus:!0,disabled:o,className:"bg-background/50 border-border focus:border-primary h-12 text-lg w-full"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-muted-foreground uppercase tracking-wider mb-4",children:"Permissions (Scopes)"}),e.jsx("div",{className:"grid grid-cols-1 gap-3",children:he.map(r=>e.jsxs("label",{className:E("flex items-center justify-between p-4 rounded-xl border cursor-pointer transition-all duration-[var(--duration-fast)] group relative overflow-hidden",l.includes(r.id)?"bg-primary/10 border-primary/50 shadow-card-glow-cyan":"bg-background/30 border-border/50 hover:border-border hover:bg-foreground/5"),children:[e.jsxs("div",{className:"flex items-center gap-4 z-10 relative",children:[e.jsx("div",{className:E("w-5 h-5 rounded border flex items-center justify-center transition-colors flex-none",l.includes(r.id)?"bg-primary border-primary":"border-border group-hover:border-kodo-content-dim"),children:l.includes(r.id)&&e.jsx(U,{className:"w-3 h-3 text-black"})}),e.jsx("span",{className:E("text-sm font-medium transition-colors",l.includes(r.id)?"text-foreground":"text-muted-foreground group-hover:text-foreground"),children:r.label})]}),e.jsx("div",{className:"text-xs font-mono text-muted-foreground z-10 hidden sm:block opacity-60 relative",children:r.id}),e.jsx("input",{type:"checkbox",className:"hidden",checked:l.includes(r.id),onChange:()=>t(r.id)})]},r.id))})]})]}):e.jsxs("div",{className:"text-center space-y-8 py-4",children:[e.jsxs("div",{className:"relative w-20 h-20 mx-auto",children:[e.jsx("div",{className:"absolute inset-0 bg-kodo-lime/20 rounded-full animate-ping opacity-50"}),e.jsx("div",{className:"relative w-full h-full bg-gradient-to-br from-kodo-lime/20 to-kodo-cyan/20 rounded-full flex items-center justify-center border border-kodo-lime/30 shadow-card-glow-cyan",children:e.jsx(U,{className:"w-10 h-10 text-success drop-shadow-lg"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-2xl font-bold text-foreground font-display",children:"Key Created Successfully"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto leading-relaxed",children:"Please copy your API key now. For security reasons, it cannot be displayed again properly."})]}),e.jsxs("div",{className:"bg-background/40 border border-border/50 rounded-xl p-1 flex items-center gap-2 relative group overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/5 to-transparent skew-x-12 translate-x-[-200%] group-hover:animate-shimmer"}),e.jsx("div",{ref:j,role:"textbox",tabIndex:0,className:"flex-1 px-4 py-3 font-mono text-sm text-warning overflow-x-auto no-scrollbar whitespace-nowrap text-left select-text cursor-text focus:outline-none focus:ring-2 focus:ring-primary/50 rounded",title:"Click to select all, then Ctrl+C to copy",onClick:P,onFocus:P,children:f}),e.jsx(x,{type:"button",variant:"ghost",size:"icon",onClick:r=>V(r),className:"h-10 w-10 text-muted-foreground hover:text-foreground hover:bg-foreground/10 rounded-lg hover:scale-105 transition-all flex-none",title:"Copy to clipboard",children:D?e.jsx(U,{className:"w-5 h-5 text-success"}):e.jsx(G,{className:"w-5 h-5"})})]})]})}),e.jsx("div",{className:"p-6 border-t border-border/50 bg-foreground/5 flex justify-end gap-3 backdrop-blur-sm flex-none z-10 transition-colors",children:a===1?e.jsxs(e.Fragment,{children:[e.jsx(x,{variant:"ghost",onClick:s,disabled:o,className:"hover:bg-foreground/10 text-muted-foreground hover:text-foreground",children:"Cancel"}),e.jsx(x,{variant:"default",onClick:r=>{r.preventDefault(),r.stopPropagation(),d(r)},disabled:o||!u.trim()||l.length===0,type:"button",className:"bg-primary hover:bg-primary/80 text-black font-semibold shadow-button-primary-glow hover:shadow-button-primary-glow-hover transition-all duration-[var(--duration-normal)]",children:o?e.jsxs(e.Fragment,{children:[e.jsx(re,{className:"w-4 h-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Key"})]}):e.jsx(x,{onClick:s,className:"bg-primary hover:bg-primary/80 text-black font-semibold min-w-24 shadow-button-primary-glow hover:shadow-button-primary-glow-hover transition-all duration-[var(--duration-normal)]",children:"Done"})})]})]}),document.body):null},B="veza_dev_api_keys",C=()=>{const s=localStorage.getItem(B);return s?JSON.parse(s):[]},T=s=>{localStorage.setItem(B,JSON.stringify(s))},k={listKeys:async()=>(await new Promise(s=>setTimeout(s,300)),C()),createKey:async s=>{await new Promise(f=>setTimeout(f,600));const c=Math.random().toString(36).substr(2,8),n=Math.random().toString(36).substr(2,16),a=`vz_${c}_${n}`,m=`vz_${c}...`,h=new Date().toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),l={id:`k-${Date.now()}`,name:s.name,prefix:m,created:h,lastUsed:"Never",status:"active",scopes:s.scopes,key:a},b=C();return T([l,...b]),l},revokeKey:async s=>{await new Promise(a=>setTimeout(a,300));const n=C().map(a=>a.id===s?{...a,status:"revoked"}:a);return T(n),{success:!0}},deleteKey:async s=>{const c=C();T(c.filter(n=>n.id!==s))},getStats:async()=>{const c=C().filter(a=>a.status==="active").length;let n=0;try{n=(await ue.list()).length}catch(a){console.error("Failed to fetch webhook stats",a)}return{requests_24h:145200+n*1240,avg_latency:45,active_keys:c,active_webhooks:n}}};function pe({specUrl:s,spec:c,useIframe:n=!1}){const a=i.useRef(null),m=i.useRef(null),[u,h]=i.useState(null),l=()=>{if(s)return s;const g=(N.API_URL.startsWith("http")?N.API_URL:`${window.location.origin}${N.API_URL}`).replace(/\/api\/v1$/,"");return n?`${g}/swagger/index.html`:`${g}/swagger/doc.json`},b=()=>`${(N.API_URL.startsWith("http")?N.API_URL:`${window.location.origin}${N.API_URL}`).replace(/\/api\/v1$/,"")}/swagger/index.html`;i.useEffect(()=>{a.current&&S.debug("Swagger UI initialized",{specUrl:s||l(),hasSpec:!!c,useIframe:n})},[s,c,n]);const f={url:c?void 0:l(),spec:c,deepLinking:!0,displayOperationId:!1,defaultModelsExpandDepth:1,defaultModelExpandDepth:1,docExpansion:"list",filter:!0,showExtensions:!0,showCommonExtensions:!0,tryItOutEnabled:!0,supportedSubmitMethods:["get","post","put","delete","patch"],requestInterceptor:o=>{const g=localStorage.getItem("access_token");g&&o.headers&&(o.headers.Authorization=`Bearer ${g}`);const p=localStorage.getItem("csrf_token");return p&&o.headers&&(o.headers["X-CSRF-Token"]=p),o},onComplete:()=>{h(null),S.debug("Swagger UI loaded successfully",{url:l()})},onFailure:o=>{h(o.message||"Failed to load Swagger documentation");const p=o.message?.includes("end of the stream")&&/<(!DOCTYPE|!--|html)/i.test(o.message)?"debug":"error";S[p]("Failed to load Swagger UI",{error:o.message,stack:o.stack,url:l()})}},v=()=>{h(null),window.location.reload()};if(n)return e.jsx("div",{ref:a,className:"swagger-ui-container",style:{height:"100%",minHeight:"600px"},children:e.jsx("iframe",{ref:m,src:b(),className:"w-full h-full border-0 rounded-lg",style:{minHeight:"600px"},title:"Swagger UI Documentation",onLoad:()=>{S.debug("Swagger UI iframe loaded successfully"),h(null)},onError:()=>{h("Failed to load Swagger UI in iframe"),S.error("Failed to load Swagger UI iframe")}})});if(u){const o=b();return e.jsxs("div",{className:"flex flex-col items-center justify-center p-12 min-h-layout-page",children:[e.jsx(ae,{className:"w-16 h-16 text-destructive mb-4"}),e.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"Failed to Load API Documentation"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4 text-center max-w-md",children:u}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-6 text-center max-w-md",children:["Trying to load from: ",l(),e.jsx("br",{}),e.jsx("span",{className:"text-kodo-steel",children:"The Swagger JSON endpoint may not be available. Try opening Swagger UI directly."})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs(x,{onClick:v,variant:"default",children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),"Retry"]}),e.jsx(x,{onClick:()=>window.open(o,"_blank"),variant:"outline",children:"Open Swagger UI"}),e.jsx(x,{onClick:()=>{window.location.reload()},variant:"outline",children:"Use Iframe Mode"})]})]})}return e.jsxs("div",{ref:a,className:"swagger-ui-container",style:{height:"100%",minHeight:"600px"},children:[e.jsx("style",{children:`
|
|
.swagger-ui-container .swagger-ui {
|
|
background: transparent;
|
|
}
|
|
.swagger-ui-container .swagger-ui .topbar {
|
|
display: none;
|
|
}
|
|
.swagger-ui-container .swagger-ui .info {
|
|
margin: 20px 0;
|
|
}
|
|
.swagger-ui-container .swagger-ui .info .title {
|
|
color: #fff;
|
|
}
|
|
.swagger-ui-container .swagger-ui .scheme-container {
|
|
background: rgba(255, 255, 255, 0.05);
|
|
padding: 10px;
|
|
border-radius: 8px;
|
|
margin: 20px 0;
|
|
}
|
|
.swagger-ui-container .swagger-ui .opblock {
|
|
background: rgba(255, 255, 255, 0.03);
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
border-radius: 8px;
|
|
margin: 10px 0;
|
|
}
|
|
.swagger-ui-container .swagger-ui .opblock.opblock-post {
|
|
border-color: rgba(102, 252, 241, 0.3);
|
|
}
|
|
.swagger-ui-container .swagger-ui .opblock.opblock-get {
|
|
border-color: rgba(102, 252, 241, 0.3);
|
|
}
|
|
.swagger-ui-container .swagger-ui .opblock.opblock-put {
|
|
border-color: rgba(255, 193, 7, 0.3);
|
|
}
|
|
.swagger-ui-container .swagger-ui .opblock.opblock-delete {
|
|
border-color: rgba(244, 67, 54, 0.3);
|
|
}
|
|
.swagger-ui-container .swagger-ui .opblock .opblock-summary {
|
|
color: #fff;
|
|
}
|
|
.swagger-ui-container .swagger-ui .opblock .opblock-description-wrapper {
|
|
color: rgba(255, 255, 255, 0.8);
|
|
}
|
|
.swagger-ui-container .swagger-ui .parameter__name {
|
|
color: #66fcf1;
|
|
}
|
|
.swagger-ui-container .swagger-ui .response-col_status {
|
|
color: #fff;
|
|
}
|
|
.swagger-ui-container .swagger-ui .response-col_description {
|
|
color: rgba(255, 255, 255, 0.8);
|
|
}
|
|
.swagger-ui-container .swagger-ui input,
|
|
.swagger-ui-container .swagger-ui select,
|
|
.swagger-ui-container .swagger-ui textarea {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
color: #fff;
|
|
}
|
|
.swagger-ui-container .swagger-ui .btn {
|
|
background: #66fcf1;
|
|
color: #000;
|
|
border: none;
|
|
}
|
|
.swagger-ui-container .swagger-ui .btn:hover {
|
|
background: #52e8e0;
|
|
}
|
|
.swagger-ui-container .swagger-ui .btn.execute {
|
|
background: #66fcf1;
|
|
color: #000;
|
|
}
|
|
.swagger-ui-container .swagger-ui .btn.cancel {
|
|
background: rgba(255, 255, 255, 0.1);
|
|
color: #fff;
|
|
}
|
|
`}),e.jsx(xe,{...f})]})}function be(){return e.jsxs("div",{className:"space-y-8 pb-20 max-w-layout-content mx-auto",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-end gap-4 border-b border-border/50 pb-6",children:[e.jsxs("div",{children:[e.jsx(y,{className:"h-9 w-56 mb-2"}),e.jsx(y,{className:"h-4 w-48"})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(y,{className:"h-10 w-36 rounded-full"}),e.jsx(y,{className:"h-10 w-32 rounded-full"})]})]}),e.jsxs("div",{className:"flex gap-2 mb-8",children:[e.jsx(y,{className:"h-10 flex-1 rounded-lg"}),e.jsx(y,{className:"h-10 flex-1 rounded-lg"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[1,2,3].map(s=>e.jsx(y,{className:"h-28 rounded-xl"},s))}),e.jsx(y,{className:"h-64 w-full rounded-xl"}),e.jsx("span",{className:"sr-only",children:"Chargement du portail développeur..."})]})}const De=()=>{const{addToast:s}=W(),{copy:c}=M(),[n,a]=i.useState(null),[m,u]=i.useState([]),[h,l]=i.useState(!0),[b,f]=i.useState(null),[v,o]=i.useState({}),[g,p]=i.useState(!1),I=async t=>{await c(t.prefix),a(t.id),s("Key prefix copied to clipboard","success"),setTimeout(()=>a(null),2e3)},j=async()=>{l(!0),f(null);try{const[t,d]=await Promise.all([k.listKeys(),k.getStats()]);u(t),o(d)}catch(t){const d=t instanceof Error?t:new Error(String(t));f(d),S.error("Error loading developer dashboard data",{error:d.message,stack:d.stack})}finally{l(!1)}};i.useEffect(()=>{j()},[]);const D=async t=>{try{const d=await k.createKey(t);return u([d,...m]),s("API Key created successfully","success"),d}catch(d){throw s("Failed to create API key","error"),d}},R=async t=>{if(confirm("Are you sure you want to revoke this key?")){await k.revokeKey(t);const d=await k.listKeys();u(d),s("API Key revoked","info")}},P=async t=>{confirm("Are you sure you want to delete this key permanently?")&&(await k.deleteKey(t),u(m.filter(d=>d.id!==t)),s("API Key deleted","info"))};return h?e.jsx(be,{}):b?e.jsx("div",{className:"py-12",children:e.jsx(Y,{error:b,variant:"card",onRetry:j})}):e.jsxs("div",{className:"space-y-8 animate-fadeIn pb-20",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-end gap-4 border-b border-border/50 pb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-display font-bold text-foreground mb-2",children:"DEVELOPER PORTAL"}),e.jsx("p",{className:"text-muted-foreground font-mono text-sm",children:"Build on top of the Veza Platform."})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(x,{variant:"secondary",icon:e.jsx(ne,{className:"w-4 h-4"}),onClick:()=>window.open("https://docs.veza.io","_blank"),children:"Documentation"}),e.jsx(x,{variant:"primary",icon:e.jsx(le,{className:"w-4 h-4"}),onClick:()=>p(!0),children:"Create API Key"})]})]}),e.jsxs(ge,{defaultValue:"overview",className:"w-full",children:[e.jsxs(me,{className:"grid w-full grid-cols-2 mb-8",children:[e.jsxs(F,{value:"overview",className:"flex items-center gap-2",children:[e.jsx($,{className:"w-4 h-4"}),"Overview & Keys"]}),e.jsxs(F,{value:"docs",className:"flex items-center gap-2",children:[e.jsx(ie,{className:"w-4 h-4"}),"API Documentation"]})]}),e.jsxs(O,{value:"overview",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[e.jsx(_,{label:"API Requests (24h)",value:v.requests_24h?.toLocaleString()||0,icon:e.jsx($,{className:"w-5 h-5"}),trend:5.2,color:"cyan"}),e.jsx(_,{label:"Avg Latency",value:`${v.avg_latency||0}ms`,icon:e.jsx(ce,{className:"w-5 h-5"}),trend:-12,color:"lime"}),e.jsx(_,{label:"Active Keys",value:m.length,icon:e.jsx(A,{className:"w-5 h-5"}),color:"gold"})]}),e.jsxs(L,{variant:"default",children:[e.jsxs(q,{className:"flex flex-row items-center justify-between space-y-0 pb-4 border-b border-border/30",children:[e.jsxs(Q,{className:"flex items-center gap-2",children:[e.jsx(A,{className:"w-4 h-4 text-warning"})," Active API Keys"]}),e.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[m.filter(t=>t.status==="active").length," active"]})]}),e.jsx(Z,{className:"pt-4",children:m.length===0?e.jsx(ee,{icon:e.jsx(A,{className:"w-12 h-12 text-muted-foreground"}),title:"No API keys yet",description:"Create your first API key to start building on the Veza Platform.",action:{label:"Create API Key",onClick:()=>p(!0),variant:"default"},variant:"card"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-xs text-muted-foreground uppercase border-b border-border/50 tracking-wider",children:[e.jsx("th",{className:"pb-3 pl-4",children:"Name"}),e.jsx("th",{className:"pb-3",children:"Key Prefix"}),e.jsx("th",{className:"pb-3",children:"Status"}),e.jsx("th",{className:"pb-3",children:"Created"}),e.jsx("th",{className:"pb-3",children:"Last Used"}),e.jsx("th",{className:"pb-3 text-right pr-4",children:"Actions"})]})}),e.jsx("tbody",{className:"text-sm",children:m.map(t=>e.jsxs("tr",{className:"border-b border-border/20 hover:bg-foreground/5 transition-colors duration-[var(--duration-fast)] group",children:[e.jsx("td",{className:"py-4 pl-4 font-bold text-foreground",children:t.name}),e.jsx("td",{className:"py-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"font-mono text-warning bg-warning/10 px-2 py-0.5 rounded text-xs",children:t.prefix}),e.jsx("button",{type:"button",onClick:()=>I(t),className:"opacity-0 group-hover:opacity-100 transition-opacity duration-[var(--duration-fast)] text-muted-foreground hover:text-foreground",title:"Copy key prefix",children:n===t.id?e.jsx(U,{className:"w-3.5 h-3.5 text-success"}):e.jsx(G,{className:"w-3.5 h-3.5"})})]})}),e.jsx("td",{className:"py-4",children:e.jsxs("span",{className:`inline-flex items-center gap-1.5 text-xs font-bold uppercase px-2 py-0.5 rounded ${t.status==="active"?"bg-success/15 text-success":"bg-destructive/15 text-destructive"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${t.status==="active"?"bg-success animate-pulse":"bg-destructive"}`}),t.status]})}),e.jsx("td",{className:"py-4 text-muted-foreground",children:t.created}),e.jsx("td",{className:"py-4 text-foreground",children:t.lastUsed}),e.jsxs("td",{className:"py-4 text-right pr-4 flex justify-end gap-2",children:[e.jsx(x,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>s("Full key hidden for security"),title:"View Key",children:e.jsx(de,{className:"w-4 h-4"})}),t.status==="active"?e.jsx(x,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:bg-destructive/10",onClick:()=>R(t.id),title:"Revoke Key",children:e.jsx(z,{className:"w-4 h-4"})}):e.jsx(x,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground hover:bg-foreground/10",onClick:()=>P(t.id),title:"Delete Permanently",children:e.jsx(z,{className:"w-4 h-4"})})]})]},t.id))})]})})})]})]}),e.jsx(O,{value:"docs",children:e.jsx(L,{variant:"default",className:"p-0 overflow-hidden bg-background/80",children:e.jsx(pe,{useIframe:!1})})})]}),g&&e.jsx(fe,{onClose:()=>p(!1),onCreate:D})]})};export{De as DeveloperDashboardView};
|