// Copyright (C) 2020 Intel Corporation // // SPDX-License-Identifier: MIT import React from 'react'; import { Row, Col } from 'antd/lib/grid'; import Select from 'antd/lib/select'; import Button from 'antd/lib/button'; import InputNumber from 'antd/lib/input-number'; import Radio, { RadioChangeEvent } from 'antd/lib/radio'; import Tooltip from 'antd/lib/tooltip'; import Text from 'antd/lib/typography/Text'; import { RectDrawingMethod } from 'cvat-canvas'; import { ShapeType } from 'reducers/interfaces'; import { clamp } from 'utils/math'; interface Props { shapeType: ShapeType; labels: any[]; minimumPoints: number; rectDrawingMethod?: RectDrawingMethod; numberOfPoints?: number; selectedLabeID: number; repeatShapeShortcut: string; onChangeLabel(value: string): void; onChangePoints(value: number | undefined): void; onChangeRectDrawingMethod(event: RadioChangeEvent): void; onDrawTrack(): void; onDrawShape(): void; } function DrawShapePopoverComponent(props: Props): JSX.Element { const { labels, shapeType, minimumPoints, selectedLabeID, numberOfPoints, rectDrawingMethod, repeatShapeShortcut, onDrawTrack, onDrawShape, onChangeLabel, onChangePoints, onChangeRectDrawingMethod, } = props; const trackDisabled = shapeType === ShapeType.POLYGON || shapeType === ShapeType.POLYLINE || (shapeType === ShapeType.POINTS && numberOfPoints !== 1); return (