import ReactMarkdown from 'react-markdown' ; import GalleryLink from '../GalleryLink/GalleryLink' ; type Props = { text : string ; } ; export default function Markdown ( { text } ) { return ( < ReactMarkdown components = { { a : ( { href , children } ) => ( < GalleryLink href = { href ?? window . location . origin } > { children } < /GalleryLink>), } } > { text } < /ReactMarkdown>); }