PeriodPicker добавлена возможность указывать доп атриббуты

This commit is contained in:
Александр Сироткин 2021-12-17 10:02:12 +05:00
parent e7fed714ee
commit cf7323ba5a

View File

@ -16,10 +16,12 @@ const timePeriodCollection = [
type PeriodPickerProps = {
defaultValue?: number
onChange?: (value: number) => void
[other: string]: any
}
export const PeriodPicker = ({ defaultValue = defaultPeriod, onChange }: PeriodPickerProps) => (
export const PeriodPicker = ({ defaultValue = defaultPeriod, onChange, ...other }: PeriodPickerProps) => (
<Select
{...other}
defaultValue={defaultValue}
onChange={(value) => onChange?.(Number(value))}
options={timePeriodCollection}