1import{e as y,o as n,r as j,j as e,L as u,t as A}from"./index-OkXy-d5Y.js";import{B as g}from"./badge-D70DEMXH.js";import{C as N,a as v,c as K,b as k}from"./card-BOYNs0rn.js";import{S as C}from"./skeleton-CTnX7jIE.js";import{A as I}from"./ApiKeyRow-Bp3E9QkA.js";import{E as b}from"./EmptyState-B-dhNU1x.js";import{g as m,h as P,b as w,r as E}from"./apiKeysSlice-CHmcOGx4.js";import{f as R,s as S}from"./appsSlice-B3WyvwFA.js";import{a as B}from"./orgsSlice-mdJJI7Vn.js";import{K as L}from"./key-BiiylvYb.js";import"./CopyButton-Bg3eIyIl.js";import"./trash-2-D_SaHreE.js";function U(){const r=y(),t=n(B),l=n(P),d=n(S),f=n(w);j.useEffect(()=>{t&&r(m({orgId:t})),r(R())},[r,t]);const h=async s=>{t&&(await r(E({orgId:t,keyId:s})),r(m({orgId:t})),A({title:"API key revoked"}))},x=l.reduce((s,o)=>{const a=o.appId??"unknown";return s[a]||(s[a]=[]),s[a].push(o),s},{});return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl",children:"All API Keys"}),e.jsx("p",{className:"text-muted-foreground",children:"API keys across all your applications"})]}),f?e.jsx("div",{className:"space-y-4",children:[1,2].map(s=>e.jsx(C,{className:"h-32 rounded-lg"},s))}):l.length===0?e.jsx(b,{icon:L,title:"No API keys",description:"Create an application first, then generate API keys from the app detail page."}):e.jsx("div",{className:"space-y-4",children:Object.entries(x).map(([s,o])=>{var p;const a=d.find(i=>{var c;return((c=i.response)==null?void 0:c.id)===s});return e.jsxs(N,{children:[e.jsx(v,{className:"flex flex-col gap-2 py-3 sm:flex-row sm:items-center sm:justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(K,{className:"text-sm",children:e.jsx(u,{to:`/dashboard/apps/${s}`,className:"hover:underline",children:((p=a==null?void 0:a.response)==null?void 0:p.name)??s})}),e.jsxs(g,{variant:"secondary",children:[o.length," keys"]})]})}),e.jsx(k,{className:"py-0 pb-2",children:o.map(i=>e.jsx(I,{apiKey:i,onRevoke:h},i.id))})]},s)})})]})}export{U as AllApiKeysPage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.