Revert ActionButton changes

This commit is contained in:
Zoltán Bedi
2023-09-26 11:11:03 +02:00
parent 50b9a83eec
commit 466cbe69ec

View File

@@ -1,4 +1,4 @@
import React, { PropsWithChildren } from 'react'; import React, { FC, PropsWithChildren } from 'react';
import { cx, css } from '@emotion/css'; import { cx, css } from '@emotion/css';
import { stylesFactory, useTheme, Tooltip } from '@grafana/ui'; import { stylesFactory, useTheme, Tooltip } from '@grafana/ui';
import { GrafanaTheme, GrafanaThemeType } from '@grafana/data'; import { GrafanaTheme, GrafanaThemeType } from '@grafana/data';
@@ -12,16 +12,14 @@ interface Props {
onClick(event: React.MouseEvent<HTMLButtonElement>): void; onClick(event: React.MouseEvent<HTMLButtonElement>): void;
} }
export const ActionButton = ({ icon, width, tooltip, className, children, onClick }: PropsWithChildren<Props>) => { export const ActionButton: FC<PropsWithChildren<Props>> = ({ icon, width, tooltip, className, children, onClick }) => {
const theme = useTheme(); const theme = useTheme();
const styles = getStyles(theme); const styles = getStyles(theme);
const buttonClass = cx( const buttonClass = cx(
'btn', 'btn',
styles.button, styles.button,
css` css`width: ${width || 3}rem`,
width: ${width || 3}rem; className,
`,
className
); );
let button = ( let button = (