import{j as e,d as p,cU as d}from"./index-Dz5JRQhj.js";const u=({value:a,setValue:n,networkList:l,hasNoneOption:o=!1,...r})=>{const i=()=>{const s=l.map(t=>({label:e.jsxs("div",{className:"label",children:[e.jsx("span",{title:t.name,className:"network-option u-truncate",children:t.name}),e.jsx("span",{title:t.type,className:"network-option u-truncate",children:t.type}),e.jsx("span",{title:"network access control lists",className:"network-option u-truncate u-align--right",children:d(t).length||"-"})]}),value:t.name,text:`${t.name} - ${t.type}`,disabled:!1,selectedLabel:e.jsxs("span",{children:[t.name," ",e.jsxs("span",{className:"u-text--muted",children:["(",t.type,")"]})]})}));return s.length===0&&s.unshift({label:e.jsx("span",{children:"No networks available"}),value:"",text:"None",disabled:!0}),o&&s.push({label:e.jsxs("div",{className:"label",children:[e.jsx("span",{title:"No network",className:"network-option u-truncate",children:"No network"}),e.jsx("span",{title:"No network type",className:"network-option u-truncate",children:"-"}),e.jsx("span",{title:"network access control lists",className:"network-option u-truncate u-align--right",children:"-"})]}),value:"none",text:"No network",disabled:!1}),s},c=()=>e.jsxs("div",{className:"header",children:[e.jsx("span",{className:"network-option u-no-margin--bottom",children:"Name"}),e.jsx("span",{className:"network-option u-no-margin--bottom",children:"Type"}),e.jsx("span",{className:"network-option u-no-margin--bottom u-align--right",children:"ACLs"})]});return e.jsx(p.CustomSelect,{label:"Network",...r,onChange:s=>{n(s)},value:a,options:i(),header:c(),dropdownClassName:"network-select-dropdown","aria-label":"Network"})};export{u as N};
