import * as React from 'react' ; import { useTranslation , Trans } from 'react-i18next' ; import { ContentPlugin , DraftPlugin , MobilizationClass as Mobilization , PluggableWidget , } from '../bonde-webpage' ; import DonationPlugin from './DonationConnected' ; import Footer from './Footer' ; import FormPlugin from './FormConnected' ; import PressureEmailPlugin from './PressureEmailConnected' ; import PressurePhonePlugin from './PressurePhoneConnected' ; import PlipPlugin from './PlipConnected' ; const plugins = [ { kind : 'draft' , component : DraftPlugin , options : { noOverlay : true } , } , { kind : 'form' , component : FormPlugin , } , { kind : 'donation' , component : DonationPlugin , } , { kind : 'pressure' , component : PressureEmailPlugin , } , { kind : 'pressure-phone' , component : PressurePhonePlugin , } , { kind : 'content' , component : ContentPlugin , } , { kind : 'plip' , component : PlipPlugin } , ] ; export interface MobilizationProperties { mobilization : any ; blocks : any [ ] ; widgets : any [ ] ; blocksIsLoaded : boolean ; } const MobilizationConnected = ( { mobilization , blocks , widgets , blocksIsLoaded , } ) : JSX . Element => { const { t , i18n } = useTranslation ( ) ; if ( mobilization && blocksIsLoaded ) { const { color_scheme : colorScheme , header_font : headerFont , body_font : bodyFont , } = mobilization ; return ( < Mobilization linkTo = { ( b ) => `block-${ b . id }` } blocks = { blocks } widgets = { widgets } widgetComponent = { PluggableWidget } footerComponent = { Footer } colorScheme = { colorScheme } headerFont = { headerFont } bodyFont = { bodyFont } extraWidgetProps = { { mobilization , editable : false , plugins , t , i18n , Trans , } } />); } return < p > Carregando mobilização < /p>; } ; export default MobilizationConnected ;