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