import{j as t,d as r}from"./index-Cziemgsu.js";import{w as p,x as o}from"./FormMenuItem-phSiN9Ls.js";const x=({label:l,value:s,help:a,setMemoryLimit:n,disabled:m})=>{const i=p(s)??{value:1,unit:o.GIB},c=()=>Object.values(o).map(e=>({label:e,value:e}));return t.jsxs("div",{children:[l&&t.jsx("label",{className:"p-form__label",htmlFor:"limits_disk",children:l}),t.jsxs("div",{className:"memory-limit-with-unit",children:[t.jsx(r.Input,{id:"limits_disk",name:"limits_disk",type:"number",min:"0",step:"Any",placeholder:"Enter value",onChange:e=>n(e.target.value+i.unit),value:s!=null&&s.match(/^\d/)?i.value:"",disabled:m}),t.jsx(r.Select,{id:"memUnitSelect",name:"memUnitSelect",label:"Select disk size unit",labelClassName:"u-off-screen",options:c(),onChange:e=>n(`${i.value??0}${e.target.value}`),value:i.unit,disabled:m})]}),a&&t.jsx("p",{className:"p-form-help-text",children:a})]})};export{x as D};
