diff --git a/app/(marketing)/documentatie/components/mdx-components.tsx b/app/(marketing)/documentatie/components/mdx-components.tsx index 3e60ad5..91be176 100644 --- a/app/(marketing)/documentatie/components/mdx-components.tsx +++ b/app/(marketing)/documentatie/components/mdx-components.tsx @@ -8,28 +8,69 @@ import Image from 'next/image' import Link from 'next/link' import type { MDXComponents } from 'mdx/types' +/** + * Generate slug from heading text for anchor links + */ +function slugify(text: string): string { + return text + .toString() + .toLowerCase() + .trim() + .replace(/\s+/g, '-') + .replace(/[^\w\-]+/g, '') + .replace(/\-\-+/g, '-') +} + +/** + * Extract text content from React children + */ +function getTextContent(children: React.ReactNode): string { + if (typeof children === 'string') return children + if (Array.isArray(children)) return children.map(getTextContent).join('') + if (children && typeof children === 'object' && 'props' in children) { + return getTextContent(children.props.children) + } + return '' +} + export const mdxComponents: MDXComponents = { // Headings with anchor links - h1: ({ children, ...props }) => ( -
+ {fullName} - ID: {patient.id} +
++ Begin met het toevoegen van een nieuwe patiënt. +
+| + Patiënt + | ++ BSN + | ++ Geboortedatum + | ++ Contact + | ++ Geslacht + | +
|---|---|---|---|---|
|
+
+
+
+ {name?.given?.[0]?.[0]}
+ {name?.family?.[0]}
+
+
+
+
+
+
+ {fullName}
+
+ ID: {patient.id}
+ |
+
+ {bsn || '-'}
+ |
+
+
+
+ |
+
+
+ {phone && (
+
+
+
+ )}
+ {email && (
+
+
+ )}
+ {!phone && !email && (
+ -
+ )}
+ |
+ + + {patient.gender === 'male' && 'Man'} + {patient.gender === 'female' && 'Vrouw'} + {patient.gender === 'other' && 'Anders'} + {patient.gender === 'unknown' && 'Onbekend'} + {!patient.gender && '-'} + + | +
+ Voeg een nieuwe patiënt toe aan het systeem (FHIR) +
++ FHIR-compliant patiëntenbeheer +
+