2024-02-14 18:56:37 +00:00
|
|
|
import React from 'react'
|
2022-04-18 16:08:58 +00:00
|
|
|
import InfoIcon from '../svgs/information-fill.svg'
|
2023-07-23 15:08:43 +00:00
|
|
|
import { useShowModal } from './modal'
|
2022-04-18 16:08:58 +00:00
|
|
|
|
2024-02-14 18:56:37 +00:00
|
|
|
export default function Info ({ children, label, iconClassName = 'fill-theme-color' }) {
|
2023-07-23 15:08:43 +00:00
|
|
|
const showModal = useShowModal()
|
2022-04-18 16:08:58 +00:00
|
|
|
|
|
|
|
return (
|
2024-02-14 18:56:37 +00:00
|
|
|
<div
|
2023-07-23 15:08:43 +00:00
|
|
|
onClick={(e) => {
|
|
|
|
e.preventDefault()
|
|
|
|
showModal(onClose => children)
|
|
|
|
}}
|
2024-03-05 22:27:29 +00:00
|
|
|
className='d-flex align-items-center pointer'
|
2024-02-14 18:56:37 +00:00
|
|
|
>
|
|
|
|
<InfoIcon
|
|
|
|
width={18} height={18} className={`${iconClassName} mx-1`}
|
|
|
|
/>
|
|
|
|
{label && <small className='text-muted'>{label}</small>}
|
|
|
|
</div>
|
2022-04-18 16:08:58 +00:00
|
|
|
)
|
|
|
|
}
|