Skip to content
Snippets Groups Projects
Unverified Commit 926b04a1 authored by Oleg Gromov's avatar Oleg Gromov Committed by GitHub
Browse files

HK: remove useCallback in WidgetStatusIcon (#38006)

parent fb696adf
Branches
Tags
No related merge requests found
import { useCallback } from "react";
import cx from "classnames";
import { Icon } from "metabase/ui";
......@@ -8,20 +7,16 @@ type Props = {
};
export function WidgetStatusIcon({ name, onClick }: Props) {
const classes = cx(
"flex-align-right flex-no-shrink",
name === "close" && "cursor-pointer",
);
const classes = cx("flex-align-right flex-no-shrink", {
"cursor-pointer": name === "close",
});
const handleOnClick = useCallback(
e => {
if (onClick) {
e.stopPropagation();
onClick();
}
},
[onClick],
);
const handleOnClick = (e: React.MouseEvent) => {
if (onClick) {
e.stopPropagation();
onClick();
}
};
return (
<Icon name={name} onClick={handleOnClick} size={12} className={classes} />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment