mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Chore: Adds neccessary packages * Wip: Initial dummy test in place * Feature: Downloads Chromium if needed * Fix: Adds global config object * Refactor: Adds basic e2eScenario * Build: Adds end to end tests to config * Build: Changes end to end job * Build: Adds browsers to image * Build: Adds failing test * Refactor: Adds first e2e-test scenario * Fix: Ignores test output in gitignore * Refactor: Adds compare screenshots ability * Refactor: Removes unnecessary code * Build: Removes jest-puppeteer * Fix: Replaces test snapshots * Refactor: Creates output dir if missing * Refactor: Changes aria-labels to be more consistent * Docs: Adds section about end to end tests * Fix: Fixes snapshots * Docs: Adds information about ENV variables
26 lines
790 B
TypeScript
26 lines
790 B
TypeScript
import React, { FC } from 'react';
|
|
import { PanelMenuItem } from '@grafana/ui';
|
|
|
|
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={`${props.text} panel menu item`}>
|
|
{props.text}
|
|
</span>
|
|
{props.shortcut && <span className="dropdown-menu-item-shortcut">{props.shortcut}</span>}
|
|
</a>
|
|
{props.children}
|
|
</li>
|
|
);
|
|
};
|