import { css } from '@emotion/css'; import { DataLink, GrafanaTheme2, LinkModel } from '@grafana/data'; import { Dropdown, Icon, Menu, ToolbarButton, useStyles2, PanelChrome } from '@grafana/ui'; interface Props { panelLinks: DataLink[]; onShowPanelLinks: () => LinkModel[]; } export function PanelLinks({ panelLinks, onShowPanelLinks }: Props) { const styles = useStyles2(getStyles); const getLinksContent = (): JSX.Element => { const interpolatedLinks = onShowPanelLinks(); return ( {interpolatedLinks?.map((link, idx) => { return ; })} ); }; if (panelLinks.length === 1) { const linkModel = onShowPanelLinks()[0]; return ( ); } else { return ( ); } } const getStyles = (theme: GrafanaTheme2) => { return { menuTrigger: css({ height: '100%', background: 'inherit', border: 'none', borderRadius: `${theme.shape.radius.default}`, cursor: 'context-menu', }), }; };