mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
* Update dependency prettier to v3 (#71586) * Update dependency prettier to v3 * run prettier * ignore prettier update in legacy select scss * update command line arg --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com> * unplug prettier --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
32 lines
716 B
TypeScript
32 lines
716 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 = ({ onClick, 'aria-label': ariaLabel, style }: Props) => {
|
|
const styles = useStyles2(getStyles);
|
|
return (
|
|
<IconButton
|
|
aria-label={ariaLabel ?? 'Close'}
|
|
className={styles}
|
|
name="times"
|
|
onClick={onClick}
|
|
style={style}
|
|
tooltip="Close"
|
|
/>
|
|
);
|
|
};
|
|
|
|
const getStyles = (theme: GrafanaTheme2) => css`
|
|
position: absolute;
|
|
right: ${theme.spacing(0.5)};
|
|
top: ${theme.spacing(1)};
|
|
`;
|