import React, { useContext } from 'react'
import { SharedDataContext } from '../markdown';

type Props = {
    [key: string]: any
}

export default function Img(props: Props) {

    const { src, alt, title, className, position } = props

    const { imageOnClick } = useContext(SharedDataContext);

    return (
        // @ts-ignore
        <img src={src} onClick={() => { imageOnClick?.(src) }} alt={alt} title={title} className={className} position={position} />
    )
}