import classNames from 'classnames'; import { useForm } from 'react-hook-form'; import ReactModal from 'react-modal'; import { BodyPart } from 'solarxr-protocol'; import { Button } from '../commons/Button'; import { CheckBox } from '../commons/Checkbox'; import { Typography } from '../commons/Typography'; import { BodyAssignment } from '../onboarding/BodyAssignment'; import { useLocalization } from '@fluent/react'; import { NeckWarningModal } from '../onboarding/NeckWarningModal'; import { useChokerWarning } from '../../hooks/choker-warning'; import { useBreakpoint } from '../../hooks/breakpoint'; export function SingleTrackerBodyAssignmentMenu({ isOpen, onClose, onRoleSelected, }: { isOpen: boolean; onClose: () => void; onRoleSelected: (role: BodyPart) => void; }) { const { isMobile } = useBreakpoint('mobile'); const { l10n } = useLocalization(); const { control, watch } = useForm<{ advanced: boolean }>({ defaultValues: { advanced: false }, }); const { advanced } = watch(); const { closeChokerWarning, tryOpenChokerWarning, shouldShowChokerWarn } = useChokerWarning({ next: onRoleSelected, }); return ( <> {l10n.getString('body_assignment_menu')} {l10n.getString('body_assignment_menu-description')} {l10n.getString('body_assignment_menu-manage_trackers')} onRoleSelected(BodyPart.NONE)} > {l10n.getString('body_assignment_menu-unassign_tracker')} closeChokerWarning(true)} accept={() => closeChokerWarning(false)} > > ); }