grafana/public/app/core/components/BackButton/BackButton.tsx
Torkel Ödegaard e505babbf4
ManageDashboards: Fixes and improvements (#23879)
* ManageDashboards: Fixes and improvements

* Fixed tests

* Fixed issue with item height and margin
2020-04-25 13:08:23 +02:00

24 lines
622 B
TypeScript

import React, { ButtonHTMLAttributes } from 'react';
import { IconButton } from '@grafana/ui';
import { e2e } from '@grafana/e2e';
export interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
surface: 'dashboard' | 'panel' | 'header';
}
export const BackButton: React.FC<Props> = ({ surface, onClick }) => {
return (
<IconButton
name="arrow-left"
tooltip="Go back (Esc)"
tooltipPlacement="bottom"
size="xxl"
surface={surface}
aria-label={e2e.components.BackButton.selectors.backArrow}
onClick={onClick}
/>
);
};
BackButton.displayName = 'BackButton';