2023-12-16 19:20:26 +03:00
|
|
|
import { BiInfoCircle } from 'react-icons/bi';
|
|
|
|
|
2024-01-04 19:38:12 +03:00
|
|
|
import TextURL from '@/components/ui/TextURL';
|
2024-01-06 03:15:02 +03:00
|
|
|
import Tooltip, { PlacesType } from '@/components/ui/Tooltip';
|
2023-12-26 14:23:51 +03:00
|
|
|
import { HelpTopic } from '@/models/miscellaneous';
|
2023-12-13 14:32:57 +03:00
|
|
|
|
2024-01-06 03:15:02 +03:00
|
|
|
import InfoTopic from '../InfoTopic';
|
2023-12-18 19:42:27 +03:00
|
|
|
import { CProps } from '../props';
|
2023-12-05 01:22:44 +03:00
|
|
|
|
2023-12-28 14:04:44 +03:00
|
|
|
interface HelpButtonProps extends CProps.Styling {
|
|
|
|
topic: HelpTopic;
|
|
|
|
offset?: number;
|
2024-01-06 03:15:02 +03:00
|
|
|
place?: PlacesType;
|
2023-12-05 01:22:44 +03:00
|
|
|
}
|
|
|
|
|
2023-12-18 19:42:27 +03:00
|
|
|
function HelpButton({ topic, ...restProps }: HelpButtonProps) {
|
2023-12-05 01:22:44 +03:00
|
|
|
return (
|
2023-12-28 14:04:44 +03:00
|
|
|
<div id={`help-${topic}`} className='p-1'>
|
|
|
|
<BiInfoCircle size='1.25rem' className='clr-text-primary' />
|
2024-01-04 19:30:10 +03:00
|
|
|
<Tooltip clickable anchorSelect={`#help-${topic}`} layer='z-modal-tooltip' {...restProps}>
|
2024-01-16 01:28:20 +03:00
|
|
|
<div className='relative' onClick={event => event.stopPropagation()}>
|
2023-12-28 14:04:44 +03:00
|
|
|
<div className='absolute right-0 text-sm top-[0.4rem]'>
|
|
|
|
<TextURL text='Справка...' href={`/manuals?topic=${topic}`} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<InfoTopic topic={topic} />
|
2024-01-04 19:30:10 +03:00
|
|
|
</Tooltip>
|
2023-12-28 14:04:44 +03:00
|
|
|
</div>
|
|
|
|
);
|
2023-12-05 01:22:44 +03:00
|
|
|
}
|
|
|
|
|
2023-12-28 14:04:44 +03:00
|
|
|
export default HelpButton;
|