import{j as e,K as m,M as i}from"./index-5768b108.js";import{S as l}from"./SelectComponent-f4c81d57.js";import{C as d}from"./CustomDatepicker-c97efda4.js";import"./index-42cce9d5.js";import"./ScrollableList-c8e84a4e.js";import"./index.esm-85e2fec5.js";import"./SectionDivider-bc494fef.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};
