mirror of
https://github.com/grafana/grafana.git
synced 2025-09-23 18:52:33 +08:00

* Add and configure eslint-plugin-import * Fix the lint:ts npm command * Autofix + prettier all the files * Manually fix remaining files * Move jquery code in jest-setup to external file to safely reorder imports * Resolve issue caused by circular dependencies within Prometheus * Update .betterer.results * Fix missing // @ts-ignore * ignore iconBundle.ts * Fix missing // @ts-ignore
31 lines
839 B
TypeScript
31 lines
839 B
TypeScript
import React, { useState } from 'react';
|
|
|
|
import { CloseButton } from 'app/core/components/CloseButton/CloseButton';
|
|
|
|
import { GeomapLayerHover } from '../event';
|
|
|
|
import { DataHoverRows } from './DataHoverRows';
|
|
import { DataHoverTabs } from './DataHoverTabs';
|
|
|
|
export interface Props {
|
|
layers?: GeomapLayerHover[];
|
|
isOpen: boolean;
|
|
onClose: () => void;
|
|
}
|
|
|
|
export const ComplexDataHoverView = ({ layers, onClose, isOpen }: Props) => {
|
|
const [activeTabIndex, setActiveTabIndex] = useState<number>(0);
|
|
|
|
if (!layers) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<>
|
|
{isOpen && <CloseButton style={{ zIndex: 1 }} onClick={onClose} />}
|
|
<DataHoverTabs layers={layers} setActiveTabIndex={setActiveTabIndex} activeTabIndex={activeTabIndex} />
|
|
<DataHoverRows layers={layers} activeTabIndex={activeTabIndex} />
|
|
</>
|
|
);
|
|
};
|