diff --git a/public/app/features/explore/ResponsiveButton.tsx b/public/app/features/explore/ResponsiveButton.tsx index 2d11e5adc76..078dfc5cdfa 100644 --- a/public/app/features/explore/ResponsiveButton.tsx +++ b/public/app/features/explore/ResponsiveButton.tsx @@ -5,7 +5,7 @@ export enum IconSide { right = 'right', } -type Props = { +interface Props extends React.HTMLAttributes { splitted: boolean; title: string; onClick: () => void; @@ -13,29 +13,41 @@ type Props = { iconClassName?: string; iconSide?: IconSide; disabled?: boolean; -}; +} function formatBtnTitle(title: string, iconSide?: string): string { return iconSide === IconSide.left ? '\xA0' + title : iconSide === IconSide.right ? title + '\xA0' : title; } -export const ResponsiveButton = forwardRef((props, ref) => { +export const ResponsiveButton = forwardRef((props, ref) => { const defaultProps = { iconSide: IconSide.left, }; + props = { ...defaultProps, ...props }; - const { title, onClick, buttonClassName, iconClassName, splitted, iconSide, disabled } = props; + const { + title, + onClick, + buttonClassName, + iconClassName, + splitted, + iconSide, + disabled, + onMouseEnter, + onMouseLeave, + } = props; return ( - +
+ +
); });