import{j as e,K as m,M as i}from"./index-aa586041.js";import{S as l}from"./SelectComponent-aad66251.js";import{C as d}from"./CustomDatepicker-26155063.js";import"./index-e3cd0864.js";import"./ScrollableList-fcc6a14c.js";import"./index.esm-5d8102a7.js";import"./SectionDivider-2f9208fa.js";const f=({control:t,watch:r,gridSize:a})=>{var n;const o=[{id:"today",name:"today"},{id:"yesterday",name:"yesterday"},{id:"week",name:"week"},{id:"month",name:"month"},{id:"year",name:"year"},{id:"custom",name:"Custom"}],s=r("start_date");return e.jsxs(e.Fragment,{children:[e.jsx(m,{size:a,children:e.jsx(l,{name:"date_range",label:"Date Range",control:t,rules:{required:!0},options:o})}),((n=r("date_range"))==null?void 0:n.value)=="custom"&&e.jsxs(e.Fragment,{children:[e.jsx(m,{size:a,children:e.jsx(i,{flex:1,children:e.jsx(d,{control:t,name:"start_date",hideAddon:!0,dateFormat:"DD-MM-YYYY",showTimeSelect:!1,timeFormat:"h:mm a",timeCaption:"time",maxDate:new Date,inputClass:"form-input",label:"Start Date",tI:1})})}),e.jsx(m,{size:a,children:e.jsx(i,{flex:1,children:e.jsx(d,{control:t,name:"end_date",hideAddon:!0,disabled:!s,dateFormat:"DD-MM-YYYY",showTimeSelect:!1,timeFormat:"h:mm a",timeCaption:"time",inputClass:"form-input",minDate:s?new Date(s):void 0,label:"End Date",tI:1,helperText:"select start date before selecting end date"})})})]})]})};export{f as D};
