import e from"prop-types";import{FormControl as r,InputLabel as t,Select as a,MenuItem as n}from"@material-ui/core";import{jsxs as i,jsx as l}from"react/jsx-runtime";var o=function(e){var o=e.label,u=e.currentValue,c=e.options,s=e.onChange;return i(r,{style:{width:"100%"},children:[o&&l(t,{shrink:!0,children:o}),l(a,{"data-testid":"".concat("PeriodSelect","_select"),value:u,onChange:function(e){s(e.target.value.includes("all")?null:e.target.value)},children:c.map((function(e){var r=e.value,t=e.label;return l(n,{"data-testid":"".concat("PeriodSelect","_option_").concat(r,"MenuItem"),value:r,children:t},r)}))})]})};o.propTypes={label:e.string,currentValue:e.string.isRequired,options:e.arrayOf(e.shape({})).isRequired,onChange:e.func.isRequired},o.defaultProps={label:""};export{o as PeriodSelect};
