diff --git a/src/app/[lang]/(DynamicLayout)/forms/[id]/layout.tsx b/src/app/[lang]/(DynamicLayout)/forms/[id]/layout.tsx index 14a84ff1..5398f15d 100644 --- a/src/app/[lang]/(DynamicLayout)/forms/[id]/layout.tsx +++ b/src/app/[lang]/(DynamicLayout)/forms/[id]/layout.tsx @@ -18,6 +18,15 @@ interface IProps { export default async function RootLayout({ children, params: { id, lang } }: IProps) { const form = await fetchForm(id, lang); + const descriptionSplit = (form?.description ?? '').split('\n'); + const description = []; + + for (let i = 0; i < descriptionSplit.length - 1; i++) { + description.push(descriptionSplit[i]); + description.push(
); + } + description.push(descriptionSplit[descriptionSplit.length - 1]); + return ( @@ -31,7 +40,7 @@ export default async function RootLayout({ children, params: { id, lang } }: IPr {form && (
)} diff --git a/src/components/ui/Header.tsx b/src/components/ui/Header.tsx index d3638b2a..b66d7b35 100644 --- a/src/components/ui/Header.tsx +++ b/src/components/ui/Header.tsx @@ -1,8 +1,9 @@ -import { Project } from '@/types/payload-types'; +import type { Project } from '@/types/payload-types'; +import type { ReactNode } from 'react'; interface IProps { title: string; - description: string; + description: ReactNode; devprops?: Project['devprops']; } @@ -15,7 +16,7 @@ export default function ProjectHeader({ title, description, devprops }: IProps) className="text-skin-header-foreground dark:text-skin-header-foreground-dark" >