|
1 |
| -import {useEffect, useRef, useState} from 'react'; |
| 1 | +import {useRef, useState} from 'react'; |
2 | 2 | import styled from '@emotion/styled';
|
3 | 3 | import {useOption} from '@react-aria/listbox';
|
4 | 4 | import type {ComboBoxState} from '@react-stately/combobox';
|
@@ -50,26 +50,9 @@ export function useSeerAcknowledgeMutation() {
|
50 | 50 | function AskSeerConsentOption<T>({state}: {state: ComboBoxState<T>}) {
|
51 | 51 | const organization = useOrganization();
|
52 | 52 | const itemRef = useRef<HTMLDivElement>(null);
|
53 |
| - const linkRef = useRef<HTMLAnchorElement>(null); |
54 | 53 | const [optionDisableOverride, setOptionDisableOverride] = useState(false);
|
55 | 54 | const {mutate: seerAcknowledgeMutate} = useSeerAcknowledgeMutation();
|
56 | 55 |
|
57 |
| - useEffect(() => { |
58 |
| - const link = linkRef.current; |
59 |
| - if (!link) return undefined; |
60 |
| - |
61 |
| - const disableOption = () => setOptionDisableOverride(true); |
62 |
| - const enableOption = () => setOptionDisableOverride(false); |
63 |
| - |
64 |
| - link.addEventListener('mouseover', disableOption); |
65 |
| - link.addEventListener('mouseout', enableOption); |
66 |
| - |
67 |
| - return () => { |
68 |
| - link.removeEventListener('mouseover', disableOption); |
69 |
| - link.removeEventListener('mouseout', enableOption); |
70 |
| - }; |
71 |
| - }, []); |
72 |
| - |
73 | 56 | const {optionProps, labelProps, isFocused, isPressed} = useOption(
|
74 | 57 | {
|
75 | 58 | key: ASK_SEER_CONSENT_ITEM_KEY,
|
@@ -108,7 +91,8 @@ function AskSeerConsentOption<T>({state}: {state: ComboBoxState<T>}) {
|
108 | 91 | {
|
109 | 92 | dataProcessingPolicy: (
|
110 | 93 | <TooltipSubExternalLink
|
111 |
| - ref={linkRef} |
| 94 | + onMouseOver={() => setOptionDisableOverride(true)} |
| 95 | + onMouseOut={() => setOptionDisableOverride(false)} |
112 | 96 | href="https://docs.sentry.io/product/security/ai-ml-policy/#use-of-identifying-data-for-generative-ai-features"
|
113 | 97 | />
|
114 | 98 | ),
|
|
0 commit comments