import{br as a,j as s,cQ as h}from"./index-DET0E_3l.js";import{E as r}from"./ExpandableList--o9sPOUL.js";import{U as c}from"./UsedByItem-DZYeZo1T.js";import{g as m}from"./storageBucket-DgrVP-De.js";const j="Instances",p="Profiles",l="Images",d="Snapshots",x="Custom volumes",u="Buckets",S=({storage:n,project:o})=>{const t={[j]:a("instance",n.used_by),[p]:a("profile",n.used_by),[l]:a("image",n.used_by),[d]:a("snapshot",n.used_by),[x]:a("volume",n.used_by),[u]:a("bucket",n.used_by)};return s.jsx("table",{children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsxs("th",{className:"u-text--muted",children:["Instances (",t[j].length,")"]}),s.jsx("td",{children:s.jsx(r,{items:t[j].map(e=>s.jsx(c,{item:e,activeProject:o,type:"instance",to:`/ui/project/${encodeURIComponent(e.project)}/instance/${encodeURIComponent(e.name)}`},`${e.name}-${e.project}`))})})]}),s.jsxs("tr",{children:[s.jsxs("th",{className:"u-text--muted",children:["Profiles (",t[p].length,")"]}),s.jsx("td",{children:s.jsx(r,{items:t[p].map(e=>s.jsx(c,{item:e,activeProject:o,type:"profile",to:`/ui/project/${encodeURIComponent(e.project)}/profile/${encodeURIComponent(e.name)}`},`${e.name}-${e.project}`))})})]}),s.jsxs("tr",{children:[s.jsxs("th",{className:"u-text--muted",children:["Images (",t[l].length,")"]}),s.jsx("td",{children:s.jsx(r,{items:t[l].map(e=>s.jsx(c,{item:e,activeProject:o,type:"image",to:`/ui/project/${encodeURIComponent(e.project)}/images`},`${e.name}-${e.project}`))})})]}),s.jsxs("tr",{children:[s.jsxs("th",{className:"u-text--muted",children:["Snapshots (",t[d].length,")"]}),s.jsx("td",{children:s.jsx(r,{items:t[d].map(e=>s.jsxs(s.Fragment,{children:[e.instance&&s.jsx(c,{item:e,activeProject:o,type:"snapshot",to:`/ui/project/${encodeURIComponent(e.project)}/instance/${encodeURIComponent(e.instance)}/snapshots`},`${e.instance}-${e.name}-${e.project}`),e.volume&&s.jsx(c,{item:e,activeProject:o,type:"snapshot",to:`${h({name:e.volume,project:e.project,pool:n.name,type:"custom",location:e.target??""})}/snapshots`},`${e.volume}-${e.name}-${e.project}-${e.target}`)]}))})})]}),s.jsxs("tr",{children:[s.jsxs("th",{className:"u-text--muted",children:["Custom volumes (",t[x].length,")"]}),s.jsx("td",{children:s.jsx(r,{items:t[x].map(e=>s.jsx(c,{item:e,activeProject:o,type:"volume",to:h({name:e.name,project:e.project,pool:n.name,type:"custom",location:e.target??""})},`${e.name}-${e.project}-${e.target}`))})})]}),s.jsxs("tr",{children:[s.jsxs("th",{className:"u-text--muted",children:["Buckets (",t[u].length,")"]}),s.jsx("td",{children:s.jsx(r,{items:t[u].map(e=>s.jsx(c,{item:e,activeProject:o,type:"bucket",to:m(e.name,n.name,e.project)},`${e.name}-${e.project}`))})})]})]})})};export{S};
