mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 04:19:26 +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
26 lines
680 B
TypeScript
26 lines
680 B
TypeScript
import { css } from '@emotion/css';
|
|
import React from 'react';
|
|
|
|
import { GrafanaTheme2 } from '@grafana/data';
|
|
import { IconButton, useStyles2 } from '@grafana/ui';
|
|
|
|
type Props = {
|
|
onClick: () => void;
|
|
'aria-label'?: string;
|
|
style?: React.CSSProperties;
|
|
};
|
|
|
|
export const CloseButton: React.FC<Props> = ({ onClick, 'aria-label': ariaLabel, style }) => {
|
|
const styles = useStyles2(getStyles);
|
|
return (
|
|
<IconButton aria-label={ariaLabel ?? 'Close'} className={styles} name="times" onClick={onClick} style={style} />
|
|
);
|
|
};
|
|
|
|
const getStyles = (theme: GrafanaTheme2) =>
|
|
css`
|
|
position: absolute;
|
|
right: ${theme.spacing(0.5)};
|
|
top: ${theme.spacing(1)};
|
|
`;
|