23 lines
607 B
JavaScript
Raw Normal View History

import React from 'react'
import InfoIcon from '@/svgs/information-fill.svg'
import { useShowModal } from '../modal'
2022-04-18 11:08:58 -05:00
export default function Info ({ children, size = 18, label, iconClassName = 'fill-theme-color' }) {
const showModal = useShowModal()
2022-04-18 11:08:58 -05:00
return (
<div
onClick={(e) => {
e.preventDefault()
showModal(onClose => children)
}}
className='pointer d-flex align-items-center'
>
<InfoIcon
width={size} height={size} className={`${iconClassName} mx-1`}
/>
{label && <small className='text-muted'>{label}</small>}
</div>
2022-04-18 11:08:58 -05:00
)
}