1
0
Fork 0
freesewing/sites/shared/components/mdx/figure.js

39 lines
928 B
JavaScript
Raw Normal View History

2021-12-25 13:43:41 +01:00
import Popout from 'shared/components/popout'
import Lightbox from 'shared/components/lightbox'
import ImageWrapper from 'shared/components/wrappers/img.js'
2021-12-25 13:43:41 +01:00
const Figure = props => {
2021-12-25 13:43:41 +01:00
const title = props?.title
? props.title
: props?.alt
? props.alt
: false
return (
<figure className="block my-4">
<Lightbox>
<ImageWrapper>
<img
src={props?.src}
alt={props?.alt || ''}
title={title || ''}
className="m-auto"
/>
</ImageWrapper>
{title
? <figcaption className="text-center italic mt-1">{title}</figcaption>
: (
<Popout fixme>
<h5>This image does not have an alt of title specified</h5>
<p>Please improve our documentation and fix this.</p>
</Popout>
)
}
</Lightbox>
2021-12-25 13:43:41 +01:00
</figure>
)
}
2021-12-19 19:08:54 +01:00
export default Figure