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