feat: migrate Payload CMS to MDX and harden static infrastructure
This commit is contained in:
41
components/MDXContent.tsx
Normal file
41
components/MDXContent.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import React from 'react';
|
||||
import { MDXRemote } from 'next-mdx-remote/rsc';
|
||||
function ContactSection(props: any) {
|
||||
return (
|
||||
<div className="p-8 border-2 border-dashed border-primary my-8 text-center text-primary font-bold">
|
||||
Contact Section Placeholder
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function HeroSection(props: any) {
|
||||
return (
|
||||
<div className="p-16 bg-primary-dark text-white text-center my-8">
|
||||
<h1 className="text-4xl font-bold">{props.title}</h1>
|
||||
<p>{props.subtitle}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Block(props: any) {
|
||||
return (
|
||||
<div className="p-4 border-2 border-dashed border-gray-300">Unknown Block: {props.type}</div>
|
||||
);
|
||||
}
|
||||
|
||||
const components = {
|
||||
ContactSection,
|
||||
HeroSection,
|
||||
Block,
|
||||
// Add other components that could be in MDX here
|
||||
};
|
||||
|
||||
export default function MDXContent({ data, className }: { data: string; className?: string }) {
|
||||
if (!data) return null;
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
<MDXRemote source={data} components={components} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user