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