From 10cf64b4d65bd3da9ae59729efeb1fe6c9092b5e Mon Sep 17 00:00:00 2001 From: goodmice Date: Fri, 19 Nov 2021 17:14:42 +0500 Subject: [PATCH] =?UTF-8?q?PeriodPicker=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D1=8C=20=D0=B2=D1=8B=D0=B7=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=20onC?= =?UTF-8?q?hange=20=D1=81=20=D1=82=D0=B8=D0=BC=D0=BF=D0=BE=D0=BC=20number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PeriodPicker.tsx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/PeriodPicker.tsx b/src/components/PeriodPicker.tsx index 615caa8..3442d0e 100644 --- a/src/components/PeriodPicker.tsx +++ b/src/components/PeriodPicker.tsx @@ -1,25 +1,25 @@ import { Select } from 'antd' -export const defaultPeriod = '600' +export const defaultPeriod = 600 const timePeriodCollection = [ - { value: '60', label: '1 минута' }, - { value: '300', label: '5 минут' }, - { value: '600', label: '10 минут' }, - { value: '1800', label: '30 минут' }, - { value: '3600', label: '1 час' }, - { value: '21600', label: '6 часов' }, - { value: '43200', label: '12 часов' }, - { value: '86400', label: '24 часа' } + { value: 60, label: '1 минута' }, + { value: 300, label: '5 минут' }, + { value: 600, label: '10 минут' }, + { value: 1800, label: '30 минут' }, + { value: 3600, label: '1 час' }, + { value: 21600, label: '6 часов' }, + { value: 43200, label: '12 часов' }, + { value: 86400, label: '24 часа' } ] -interface PeriodPickerProps { - defaultValue?: string - onChange?: (value: string, option: any) => void +type PeriodPickerProps = { + defaultValue?: number + onChange?: (value: number) => void } export const PeriodPicker = ({ defaultValue = defaultPeriod, onChange }: PeriodPickerProps) => ( - onChange?.(Number(value))}> {timePeriodCollection.map(period => ( {period.label}