Skip to content

Commit 1cbb7f2

Browse files
committed
fixes
1 parent 8223f37 commit 1cbb7f2

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/components/ControlPlane/MCPHealthPopoverButton.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import {
66
FlexBoxJustifyContent,
77
Button,
88
PopoverDomRef,
9+
ButtonDomRef,
910
} from '@ui5/webcomponents-react';
1011
import { AnalyticalTableColumnDefinition } from '@ui5/webcomponents-react/wrappers';
1112
import PopoverPlacement from '@ui5/webcomponents/dist/types/PopoverPlacement.js';
1213
import '@ui5/webcomponents-icons/dist/copy';
13-
import { JSX, useRef, useState, MouseEvent, ReactNode } from 'react';
14+
import { JSX, useRef, useState, ReactNode } from 'react';
15+
import type { ButtonClickEventDetail } from '@ui5/webcomponents/dist/Button.js';
1416
import {
1517
ControlPlaneStatusType,
1618
ReadyStatus,
@@ -21,6 +23,7 @@ import { AnimatedHoverTextButton } from '../Helper/AnimatedHoverTextButton.tsx';
2123
import { useTranslation } from 'react-i18next';
2224
import { useLink } from '../../lib/shared/useLink.ts';
2325
import TooltipCell from '../Shared/TooltipCell.tsx';
26+
import type { Ui5CustomEvent } from '@ui5/webcomponents-react-base';
2427

2528
interface CellData<T> {
2629
cell: {
@@ -46,9 +49,9 @@ const MCPHealthPopoverButton = ({ mcpStatus, projectName, workspaceName, mcpName
4649
const { githubIssuesSupportTicket } = useLink();
4750
const { t } = useTranslation();
4851

49-
const handleOpenerClick = (e: MouseEvent<HTMLButtonElement>) => {
52+
const handleOpenerClick = (event: Ui5CustomEvent<ButtonDomRef, ButtonClickEventDetail>) => {
5053
if (popoverRef.current) {
51-
(popoverRef.current as unknown as { opener: EventTarget | null }).opener = e.target;
54+
(popoverRef.current as unknown as { opener: EventTarget | null }).opener = event.target;
5255
setOpen((prev) => !prev);
5356
}
5457
};

src/components/Helper/AnimatedHoverTextButton.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { Button, ButtonDomRef, FlexBox, FlexBoxAlignItems, Text } from '@ui5/web
22
import '@ui5/webcomponents-icons/dist/copy';
33
import { JSX, RefObject, useState } from 'react';
44
import ButtonDesign from '@ui5/webcomponents/dist/types/ButtonDesign.js';
5+
import type { Ui5CustomEvent } from '@ui5/webcomponents-react-base';
6+
import type { ButtonClickEventDetail } from '@ui5/webcomponents/dist/Button.js';
57

68
type HoverTextButtonProps = {
79
text: string;
810
icon: JSX.Element;
911
ref?: RefObject<ButtonDomRef | null>;
10-
onClick: () => void;
12+
onClick: (event: Ui5CustomEvent<ButtonDomRef, ButtonClickEventDetail>) => void;
1113
};
1214
export const AnimatedHoverTextButton = ({ text, icon, onClick, ref }: HoverTextButtonProps) => {
1315
const [hover, setHover] = useState(false);

0 commit comments

Comments
 (0)