stacker.news/components/info.js

17 lines
420 B
JavaScript
Raw Normal View History

2022-04-18 16:08:58 +00:00
import InfoIcon from '../svgs/information-fill.svg'
import { useShowModal } from './modal'
2022-04-18 16:08:58 +00:00
2023-06-20 17:55:45 +00:00
export default function Info ({ children, iconClassName = 'fill-theme-color' }) {
const showModal = useShowModal()
2022-04-18 16:08:58 +00:00
return (
<InfoIcon
2023-07-24 18:35:05 +00:00
width={18} height={18} className={`${iconClassName} pointer ms-1`}
onClick={(e) => {
e.preventDefault()
showModal(onClose => children)
}}
/>
2022-04-18 16:08:58 +00:00
)
}