import React, { Suspense } from 'react'; import { PlacesType, Tooltip } from '@/components/Container'; import { TextURL } from '@/components/Control'; import { IconHelp } from '@/components/Icons'; import { Loader } from '@/components/Loader'; import { CProps } from '@/components/props'; import { usePreferencesStore } from '@/stores/preferences'; import { HelpTopic } from '../models/helpTopic'; const TopicPage = React.lazy(() => import('@/features/help/pages/ManualsPage/TopicPage').then(module => ({ default: module.TopicPage })) ); interface BadgeHelpProps extends CProps.Styling { /** Topic to display in a tooltip. */ topic: HelpTopic; /** Offset from the cursor to the tooltip. */ offset?: number; /** Classname for padding. */ padding?: string; /** Place of the tooltip in relation to the cursor. */ place?: PlacesType; } /** * Display help icon with a manual page tooltip. */ export function BadgeHelp({ topic, padding = 'p-1', ...restProps }: BadgeHelpProps) { const showHelp = usePreferencesStore(state => state.showHelp); if (!showHelp) { return null; } return (