import * as React from 'react'; import { useOutsideClose } from '../../shared/hooks/useOutsideClose'; import { HUB_TEXTS } from './texts'; import styles from './HubPage.module.scss'; const TEXTS = HUB_TEXTS.export; /** Кнопка «?» с подсказкой о типах отчётов. Закрывается повторным кликом, кликом мимо или Esc. */ export const ExportInfoButton: React.FC = () => { const [isOpen, setIsOpen] = React.useState(false); const wrapperRef = React.useRef(null); useOutsideClose(wrapperRef, isOpen, () => setIsOpen(false)); return ( {isOpen && ( {TEXTS.infoRows.map((row) => ( {row.label} {row.text} ))} )} ); };