import{j as e,K as m,M as i}from"./index-6fe66247.js";import{S as l}from"./SelectComponent-378c45a1.js";import{C as d}from"./CustomDatepicker-8082706c.js";import"./index-b6aec95e.js";import"./ScrollableList-0f8e556e.js";import"./index.esm-34c2a639.js";import"./SectionDivider-ea552de1.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};
