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 = { type PeriodPickerProps = {
defaultValue?: number defaultValue?: number
onChange?: (value: number) => void onChange?: (value: number) => void
[other: string]: any
} }
export const PeriodPicker = ({ defaultValue = defaultPeriod, onChange }: PeriodPickerProps) => ( export const PeriodPicker = ({ defaultValue = defaultPeriod, onChange, ...other }: PeriodPickerProps) => (
<Select <Select
{...other}
defaultValue={defaultValue} defaultValue={defaultValue}
onChange={(value) => onChange?.(Number(value))} onChange={(value) => onChange?.(Number(value))}
options={timePeriodCollection} options={timePeriodCollection}