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