import{Tab_default as e,Tabs_default as t}from"./Tabs-D-yJFW4I.js";import{Box_default as n,ButtonWithLoading as r,DateTimePickerComponent as i,__toESM as a,jsx as o,jsxs as s,makeStyles_default as c,require_react as l}from"./index-D6C_Nj7C.js";import{require_lib as u}from"./use-location-from-lt-miCzg9X2.js";var d=a(l()),f=a(u());function p(e){let{children:t,value:r,index:i,...a}=e;return o(`div`,{role:`tabpanel`,hidden:r!==i,id:`full-width-tabpanel-${i}`,"aria-labelledby":`full-width-tab-${i}`,...a,children:r===i&&o(n,{p:3,width:`100%`,children:t})})}function m(e){return{id:`full-width-tab-${e}`,"aria-controls":`full-width-tabpanel-${e}`}}const h=c(e=>({root:{backgroundColor:e.palette.background.paper,width:`100%`}}));function g({hide:n,showModal:a,onSubmit:c,initialStartDateTime:l,initialEndDateTime:u}){let g=h(),[_,v]=(0,d.useState)(0),[y,b]=(0,d.useState)(!1),[x,S]=(0,d.useState)(new Date),[C,w]=(0,d.useState)(new Date),T=(e,t)=>{v(t)},E=e=>{v(e)},D=()=>{c(x,C)};return(0,d.useEffect)(()=>{a&&(S(l),w(u))},[a]),s(`div`,{className:g.root,children:[s(t,{value:_,onChange:T,indicatorColor:`primary`,textColor:`primary`,variant:`fullWidth`,"aria-label":`full width tabs example`,children:[o(e,{label:`1. Select Date From`,...m(0)}),o(e,{label:`2. Select Date to`,...m(1)})]}),s(f.default,{axis:`x`,index:_,onChangeIndex:E,children:[o(p,{value:_,index:0,dir:`x`,children:o(i,{value:x,onChange:e=>S(e)})}),o(p,{value:_,index:1,dir:`x`,children:o(i,{value:C,onChange:e=>w(e)})})]}),o(r,{onClick:D,variant:`outlined`,fullWidth:!0,color:`primary`,isLoading:y,children:`Apply filter`})]})}export{g as RangePickerComponent};
//# sourceMappingURL=range-picker.component-bzmQjtwF.js.map