Files
j_kedzierski/src/blocks/ContactSection/Component.tsx
T

24 lines
655 B
TypeScript

import React from 'react'
import type { Page } from '../../payload-types'
import { ContactSectionClient } from './Client'
import { FormRenderer } from '../../components/FormRenderer'
type Props = Extract<NonNullable<Page['layout']>[0], { blockType: 'contactSection' }>
export const ContactSectionBlock: React.FC<Props> = (props) => {
const { form } = props
return (
<ContactSectionClient
{...props}
formNode={
typeof form === 'object' && form !== null ? (
<FormRenderer form={form} />
) : (
<p className="text-foreground/60">Formularz nie został podpięty.</p>
)
}
/>
)
}