ConceptPortal-public/rsconcept/frontend/src/components/man/HelpButton.tsx

33 lines
1.0 KiB
TypeScript
Raw Normal View History

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