Files
Compass/web/pages/support.tsx
2025-09-26 22:17:24 +02:00

20 lines
600 B
TypeScript

import fs from 'fs';
import path from 'path';
import MarkdownPage from "web/components/markdown";
const FILENAME = __filename.split('/').pop()?.split('.').shift();
export async function getStaticProps() {
const filePath = path.join(process.cwd(), 'public', 'md', FILENAME + '.md');
const content = fs.readFileSync(filePath, 'utf8');
return {props: {content}};
}
type Props = { content: string };
export default function Faq({content}: Props) {
if (!FILENAME) throw new Error('Could not determine filename');
return <MarkdownPage content={content} filename={FILENAME}></MarkdownPage>
}