import * as React from 'react' ; import { useSelector , useDispatch } from 'react-redux' ; import { getAnalyticsOptInSeen , setAnalyticsOptInSeen , } from '../../redux/analytics' ; import { Modal , OutlineButton } from '@opentrons/components' ; import { AnalyticsToggle } from './AnalyticsToggle' ; import { Portal } from '../../App/portal' ; import type { Dispatch } from '../../redux/types' ; const TITLE = 'Privacy Settings' ; const CONTINUE = 'continue' ; export function AnalyticsSettingsModal ( ) { const dispatch = useDispatch < Dispatch > ( ) ; const seen = useSelector ( getAnalyticsOptInSeen ) ; const setSeen = ( ) : unknown => dispatch ( setAnalyticsOptInSeen ( ) ) ; return ! seen ? ( < Portal > < Modal onCloseClick = { setSeen } heading = { TITLE } alertOverlay > < AnalyticsToggle /> < OutlineButton onClick = { setSeen } float = "right" margin = "0.75rem" > { CONTINUE } < /OutlineButton> < /Modal> < /Portal>) : null; }