2020-01-18 00:18:09 +00:00
|
|
|
import Image from '@hashicorp/react-image'
|
2021-02-11 21:29:38 +00:00
|
|
|
import InlineSvg from '@hashicorp/react-inline-svg'
|
2021-05-03 22:01:29 +00:00
|
|
|
import alertIcon from 'public/img/icons/alert.svg?include'
|
|
|
|
import checkIcon from 'public/img/icons/check.svg?include'
|
2021-02-11 21:29:38 +00:00
|
|
|
import fragment from './fragment.graphql'
|
|
|
|
import s from './style.module.css'
|
2020-01-18 00:18:09 +00:00
|
|
|
function BeforeAfterDiagram(props) {
|
|
|
|
const {
|
|
|
|
theme,
|
|
|
|
beforeHeadline,
|
|
|
|
beforeContent,
|
|
|
|
beforeImage,
|
|
|
|
afterHeadline,
|
|
|
|
afterContent,
|
2021-02-11 21:29:38 +00:00
|
|
|
afterImage,
|
2020-01-18 00:18:09 +00:00
|
|
|
} = props
|
|
|
|
return (
|
2021-02-11 21:29:38 +00:00
|
|
|
<div className={s.beforeAfterDiagram} data-theme={theme}>
|
|
|
|
<div className={s.beforeSide}>
|
|
|
|
<div className={s.image}>
|
2020-01-18 00:18:09 +00:00
|
|
|
<div>
|
|
|
|
<Image {...beforeImage} />
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-02-11 21:29:38 +00:00
|
|
|
<div className={s.contentContainer}>
|
|
|
|
<span className={s.iconLineContainer}>
|
|
|
|
<InlineSvg className={s.beforeIcon} src={alertIcon} />
|
2021-05-03 22:01:29 +00:00
|
|
|
<span className={s.lineSegment} />
|
2020-01-18 00:18:09 +00:00
|
|
|
</span>
|
|
|
|
<div>
|
|
|
|
{beforeHeadline && (
|
2021-06-21 16:50:59 +00:00
|
|
|
<h2
|
2021-02-11 21:29:38 +00:00
|
|
|
className={s.contentHeadline}
|
2020-01-18 00:18:09 +00:00
|
|
|
dangerouslySetInnerHTML={{
|
2021-02-11 21:29:38 +00:00
|
|
|
__html: beforeHeadline,
|
2020-01-18 00:18:09 +00:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
{beforeContent && (
|
|
|
|
<div
|
2021-02-11 21:29:38 +00:00
|
|
|
className={s.beforeContent}
|
2020-01-18 00:18:09 +00:00
|
|
|
dangerouslySetInnerHTML={{
|
2021-02-11 21:29:38 +00:00
|
|
|
__html: beforeContent,
|
2020-01-18 00:18:09 +00:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-02-11 21:29:38 +00:00
|
|
|
<div className={s.afterSide}>
|
|
|
|
<div className={s.image}>
|
2020-01-18 00:18:09 +00:00
|
|
|
<div>
|
|
|
|
<Image {...afterImage} />
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-02-11 21:29:38 +00:00
|
|
|
<div className={s.contentContainer}>
|
|
|
|
<span className={s.iconLineContainer}>
|
|
|
|
<InlineSvg className={s.afterIcon} src={checkIcon} />
|
|
|
|
</span>
|
2020-01-18 00:18:09 +00:00
|
|
|
<div>
|
|
|
|
{afterHeadline && (
|
2021-06-21 16:50:59 +00:00
|
|
|
<h2
|
2021-02-11 21:29:38 +00:00
|
|
|
className={s.contentHeadline}
|
2020-01-18 00:18:09 +00:00
|
|
|
dangerouslySetInnerHTML={{
|
2021-02-11 21:29:38 +00:00
|
|
|
__html: afterHeadline,
|
2020-01-18 00:18:09 +00:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
{afterContent && (
|
|
|
|
<div
|
2021-02-11 21:29:38 +00:00
|
|
|
className={s.afterContent}
|
|
|
|
data-theme={theme}
|
2020-01-18 00:18:09 +00:00
|
|
|
dangerouslySetInnerHTML={{
|
2021-02-11 21:29:38 +00:00
|
|
|
__html: afterContent,
|
2020-01-18 00:18:09 +00:00
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-02-11 21:29:38 +00:00
|
|
|
BeforeAfterDiagram.fragmentSpec = { fragment, dependencies: [Image] }
|
2020-01-18 00:18:09 +00:00
|
|
|
|
2021-02-11 21:29:38 +00:00
|
|
|
export default BeforeAfterDiagram
|