mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
* Refactor: Adds params to visit * Refactor: Restructures exported Pages somewhat * Refactor: Moves more into new framework but holdup because of bugs in digest * Refactor: Finish migrating templating e2e tests to new framework * Refactor: Changes after merge with master * Refactor: Removes weird change * Refactor: Adds duplication test * Refactor: Adds move down and move up variable asserts * Refactor: Adds some test to value select dropdown
30 lines
892 B
TypeScript
30 lines
892 B
TypeScript
import React, { FC } from 'react';
|
|
import { PanelMenuItem } from '@grafana/data';
|
|
import { e2e } from '@grafana/e2e';
|
|
|
|
interface Props {
|
|
children: any;
|
|
}
|
|
|
|
export const PanelHeaderMenuItem: FC<Props & PanelMenuItem> = props => {
|
|
const isSubMenu = props.type === 'submenu';
|
|
const isDivider = props.type === 'divider';
|
|
return isDivider ? (
|
|
<li className="divider" />
|
|
) : (
|
|
<li className={isSubMenu ? 'dropdown-submenu' : null}>
|
|
<a onClick={props.onClick}>
|
|
{props.iconClassName && <i className={props.iconClassName} />}
|
|
<span
|
|
className="dropdown-item-text"
|
|
aria-label={e2e.pages.Dashboard.Panels.Panel.selectors.headerItems(props.text)}
|
|
>
|
|
{props.text}
|
|
</span>
|
|
{props.shortcut && <span className="dropdown-menu-item-shortcut">{props.shortcut}</span>}
|
|
</a>
|
|
{props.children}
|
|
</li>
|
|
);
|
|
};
|