import{j as e,K as m,M as i}from"./index-c1429e77.js";import{S as l}from"./SelectComponent-f3230d63.js";import{C as d}from"./CustomDatepicker-9a80af6c.js";import"./index-938f4514.js";import"./ScrollableList-85f6c22b.js";import"./index.esm-85841cf7.js";import"./SectionDivider-0f38a779.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};
