2022-04-18 16:08:58 +00:00
|
|
|
import { useState } from 'react'
|
|
|
|
import { Modal } from 'react-bootstrap'
|
|
|
|
import InfoIcon from '../svgs/information-fill.svg'
|
|
|
|
|
2023-06-20 17:55:45 +00:00
|
|
|
export default function Info ({ children, iconClassName = 'fill-theme-color' }) {
|
2022-04-18 16:08:58 +00:00
|
|
|
const [info, setInfo] = useState()
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Modal
|
|
|
|
show={info}
|
|
|
|
onHide={() => setInfo(false)}
|
|
|
|
>
|
|
|
|
<div className='modal-close' onClick={() => setInfo(false)}>X</div>
|
|
|
|
<Modal.Body>
|
|
|
|
{children}
|
|
|
|
</Modal.Body>
|
|
|
|
</Modal>
|
2022-09-02 16:58:16 +00:00
|
|
|
<InfoIcon
|
2023-06-20 17:55:45 +00:00
|
|
|
width={18} height={18} className={`${iconClassName} pointer ml-1`}
|
2022-09-02 16:58:16 +00:00
|
|
|
onClick={(e) => {
|
|
|
|
e.preventDefault()
|
|
|
|
setInfo(true)
|
|
|
|
}}
|
|
|
|
/>
|
2022-04-18 16:08:58 +00:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|