import{a as m,R as t,c as p,D as b,T as o,d as u,e as M,B as h}from"./index-Bm2SqMk3.js";function f(N){const{model:r,handleClose:l}=N,{minScore:s,maxScore:c,scaleType:E}=r,[e,d]=m.useState(`${s!==Number.MIN_VALUE?s:""}`),[a,g]=m.useState(`${c!==Number.MAX_VALUE?c:""}`),i=e!==""&&a!==""&&!Number.isNaN(+e)&&!Number.isNaN(+a)?+a>+e:!0,x=E==="log"&&e!==""&&!Number.isNaN(+e)?+e>0:!0;return t.createElement(p.Dialog,{open:!0,onClose:l,title:"Set min/max score for track"},t.createElement(b,null,t.createElement(o,null,"Enter min/max score: "),i?null:t.createElement(o,{color:"error"},"Max is greater than or equal to min"),x?null:t.createElement(o,{color:"error"},"Min score should be greater than 0 for log scale"),t.createElement(u,{value:e,onChange:n=>{d(n.target.value)},placeholder:"Enter min score"}),t.createElement(u,{value:a,onChange:n=>{g(n.target.value)},placeholder:"Enter max score"})),t.createElement(M,null,t.createElement(h,{variant:"contained",color:"primary",type:"submit",style:{marginLeft:20},disabled:!i,onClick:()=>{r.setMinScore(e!==""&&!Number.isNaN(+e)?+e:void 0),r.setMaxScore(a!==""&&!Number.isNaN(+a)?+a:void 0),l()}},"Submit")))}export{f as default};
