/* eslint-disable no-nested-ternary */ import './ExplorerOptionsDroppableArea.styles.scss'; import { useDroppable } from '@dnd-kit/core'; import { Color } from '@signozhq/design-tokens'; import { Button, Tooltip } from 'antd'; import { Disc3, X } from 'lucide-react'; import { Dispatch, SetStateAction } from 'react'; import { DataSource } from 'types/common/queryBuilder'; import { setExplorerToolBarVisibility } from './utils'; interface DroppableAreaProps { isQueryUpdated: boolean; isExplorerOptionHidden?: boolean; sourcepage: DataSource; setIsExplorerOptionHidden?: Dispatch>; handleClearSelect: () => void; onUpdateQueryHandler: () => void; } function ExplorerOptionsDroppableArea({ isQueryUpdated, isExplorerOptionHidden, sourcepage, setIsExplorerOptionHidden, handleClearSelect, onUpdateQueryHandler, }: DroppableAreaProps): JSX.Element { const { setNodeRef } = useDroppable({ id: 'explorer-options-droppable', }); const handleShowExplorerOption = (): void => { if (setIsExplorerOptionHidden) { setIsExplorerOptionHidden(false); setExplorerToolBarVisibility(true, sourcepage); } }; return (
{isExplorerOptionHidden && ( <> {isQueryUpdated && (
)} )}
); } ExplorerOptionsDroppableArea.defaultProps = { isExplorerOptionHidden: undefined, setIsExplorerOptionHidden: undefined, }; export default ExplorerOptionsDroppableArea;