11import { useEffect , useMemo , useRef } from 'react'
22import { useTranslation } from 'react-i18next'
33import { Box , Text , VisuallyHidden } from '@chakra-ui/react'
4+ import { useFeatureValue } from '@growthbook/growthbook-react'
45import { format } from 'date-fns'
56
67import {
@@ -11,6 +12,8 @@ import {
1112 PublicFormDto ,
1213} from '~shared/types/form'
1314
15+ import { OgpAwarenessBadge } from '~assets/svgrs/brand/OgpAwarenessBadge'
16+ import { OgpAwarenessBanner } from '~assets/svgrs/brand/OgpAwarenessBanner'
1417import { useMdComponents } from '~hooks/useMdComponents'
1518import { getValueInSelectedLanguage } from '~utils/multiLanguage'
1619import { MarkdownText } from '~components/MarkdownText'
@@ -85,6 +88,18 @@ export const EndPageBlock = ({
8588 return 'You have successfully submitted your response.'
8689 } , [ formTitle ] )
8790
91+ const ogpAwareness = useFeatureValue ( 'ogp-awareness' , 'none' )
92+ const ogpAwarenessComponent = ( ( ) => {
93+ switch ( ogpAwareness ) {
94+ case 'banner' :
95+ return < OgpAwarenessBanner />
96+ case 'badge' :
97+ return < OgpAwarenessBadge />
98+ default :
99+ return < > </ >
100+ }
101+ } ) ( )
102+
88103 return (
89104 < >
90105 < Box ref = { focusRef } >
@@ -100,6 +115,7 @@ export const EndPageBlock = ({
100115 </ Box >
101116 ) : null }
102117 </ Box >
118+ { ogpAwareness && < Box mt = "1rem" > { ogpAwarenessComponent } </ Box > }
103119 < Box mt = "1rem" >
104120 < Box >
105121 < Text textColor = "secondary.300" textStyle = "caption-2" >
0 commit comments