// Copyright (C) 2020 Intel Corporation // // SPDX-License-Identifier: MIT import React, { useState } from 'react'; import { Row, Col } from 'antd/lib/grid'; import Icon from 'antd/lib/icon'; import Select, { OptionProps } from 'antd/lib/select'; import Dropdown from 'antd/lib/dropdown'; import Text from 'antd/lib/typography/Text'; import Tooltip from 'antd/lib/tooltip'; import { ObjectType, ShapeType, ColorBy } from 'reducers/interfaces'; import ItemMenu from './object-item-menu'; interface Props { clientID: number; serverID: number | undefined; labelID: number; labels: any[]; shapeType: ShapeType; objectType: ObjectType; color: string; colorBy: ColorBy; type: string; locked: boolean; changeColorShortcut: string; copyShortcut: string; pasteShortcut: string; propagateShortcut: string; toBackgroundShortcut: string; toForegroundShortcut: string; removeShortcut: string; changeColor(color: string): void; changeLabel(labelID: string): void; copy(): void; remove(): void; propagate(): void; createURL(): void; switchOrientation(): void; toBackground(): void; toForeground(): void; resetCuboidPerspective(): void; } function ItemTopComponent(props: Props): JSX.Element { const { clientID, serverID, labelID, labels, shapeType, objectType, color, colorBy, type, locked, changeColorShortcut, copyShortcut, pasteShortcut, propagateShortcut, toBackgroundShortcut, toForegroundShortcut, removeShortcut, changeColor, changeLabel, copy, remove, propagate, createURL, switchOrientation, toBackground, toForeground, resetCuboidPerspective, } = props; const [menuVisible, setMenuVisible] = useState(false); const [colorPickerVisible, setColorPickerVisible] = useState(false); const changeMenuVisible = (visible: boolean): void => { if (!visible && colorPickerVisible) return; setMenuVisible(visible); }; const changeColorPickerVisible = (visible: boolean): void => { if (!visible) { setMenuVisible(false); } setColorPickerVisible(visible); }; return ( {clientID}
{type}
); } export default React.memo(ItemTopComponent);