Files
stroy-bot-monorepo/src/webparts/stroyBot/pages/hub/ExportInfoButton.tsx
T
Тимур Городецкий bed230f045 feat: port stroy-bot-main as the hub page
Project picker, section cards and the period Excel export now live on the
app's home page. The selected project is shared app state, so the sidebar
hides sections with the same rules main used to disable its cards
(archived, finished, no edit0 right).

Queries are 1:1 with stroy-bot-main and covered by tests against a fake
HTTP client. Behaviour differences are listed in the migration checklist.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 16:49:32 +05:00

38 lines
1.2 KiB
TypeScript

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<boolean>(false);
const wrapperRef = React.useRef<HTMLSpanElement>(null);
useOutsideClose(wrapperRef, isOpen, () => setIsOpen(false));
return (
<span className={styles.infoWrapper} ref={wrapperRef}>
<button
type="button"
className={styles.infoButton}
aria-label={TEXTS.infoAriaLabel}
aria-expanded={isOpen}
onClick={() => setIsOpen((prev) => !prev)}
>
?
</button>
{isOpen && (
<span className={styles.infoPopover} role="tooltip">
{TEXTS.infoRows.map((row) => (
<span key={row.label} className={styles.infoRow}>
<strong>{row.label}</strong> {row.text}
</span>
))}
</span>
)}
</span>
);
};