import{j as e,K as m,M as i}from"./index-7d3dbb9c.js";import{S as l}from"./SelectComponent-b1bc4bdd.js";import{C as d}from"./CustomDatepicker-6d5ad1ab.js";import"./index-b5c17d61.js";import"./ScrollableList-ffeab0b0.js";import"./index.esm-9d396c5f.js";import"./SectionDivider-be0a23cf.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};
