import{a as u,j as i}from"./vendor-query-B2UbickB.js";import{u as x}from"./index-BZu5zewH.js";import{D as d,f as v}from"./constants-BHkpVaqx.js";function j(){const{data:e}=x();return u.useMemo(()=>{var n;return(((n=e==null?void 0:e.escalation)==null?void 0:n.claimDurations)??d).map(a=>({value:String(a),label:v(a)}))},[e])}const f=[{value:1,label:"minutes"},{value:60,label:"hours"}];function C({onChange:e,compact:r,autoFocus:n,"data-testid":a="custom-duration-input"}){const[l,m]=u.useState(""),[s,c]=u.useState(1);u.useEffect(()=>{const t=parseInt(l);e(t>0?t*s:0)},[l,s,e]);const o=r?"text-xs":"text-sm",p=r?"w-16":"w-20";return i.jsxs("div",{className:"flex items-center gap-2","data-testid":a,children:[i.jsx("input",{type:"number",min:1,max:s===60?24:1440,value:l,onChange:t=>m(t.target.value),placeholder:s===60?"hrs":"min",className:`input ${o} ${p} text-center`,autoFocus:n,"data-testid":`${a}-quantity`}),i.jsx("select",{value:s,onChange:t=>c(parseInt(t.target.value)),className:`select ${o} py-1`,"data-testid":`${a}-unit`,children:f.map(t=>i.jsx("option",{value:t.value,children:t.label},t.value))})]})}export{C,j as u};
//# sourceMappingURL=CustomDurationPicker-CLq8B89Y.js.map
