2023-12-16 19:20:26 +03:00
|
|
|
import { BiInfoCircle } from 'react-icons/bi';
|
|
|
|
|
2023-12-13 14:32:57 +03:00
|
|
|
import ConceptTooltip from '@/components/Common/ConceptTooltip';
|
|
|
|
import TextURL from '@/components/Common/TextURL';
|
|
|
|
import { HelpTopic } from '@/models/miscelanious';
|
|
|
|
|
2023-12-05 01:22:44 +03:00
|
|
|
import InfoTopic from './InfoTopic';
|
|
|
|
|
|
|
|
interface HelpButtonProps {
|
|
|
|
topic: HelpTopic
|
|
|
|
offset?: number
|
|
|
|
dimensions?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
function HelpButton({ topic, offset, dimensions }: HelpButtonProps) {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div
|
|
|
|
id={`help-${topic}`}
|
2023-12-15 17:34:50 +03:00
|
|
|
className='p-1'
|
2023-12-05 01:22:44 +03:00
|
|
|
>
|
2023-12-16 19:20:26 +03:00
|
|
|
<BiInfoCircle size='1.25rem' className='clr-text-primary' />
|
2023-12-05 01:22:44 +03:00
|
|
|
</div>
|
|
|
|
<ConceptTooltip clickable
|
|
|
|
anchorSelect={`#help-${topic}`}
|
|
|
|
layer='z-modal-tooltip'
|
|
|
|
className={dimensions}
|
|
|
|
offset={offset}
|
|
|
|
>
|
|
|
|
<div className='relative'>
|
|
|
|
<div className='absolute right-0 text-sm top-[0.4rem]'>
|
|
|
|
<TextURL text='Справка...' href={`/manuals?topic=${topic}`} />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<InfoTopic topic={topic} />
|
|
|
|
</ConceptTooltip>
|
|
|
|
</>);
|
|
|
|
}
|
|
|
|
|
2023-12-13 14:32:57 +03:00
|
|
|
export default HelpButton;
|