34 lines
1.0 KiB
TypeScript
Raw Normal View History

2025-02-13 23:04:40 +01:00
import fs from "fs"
import path from "path"
2025-02-14 18:31:15 +01:00
import ReactMarkdown from "react-markdown"
2025-02-14 18:52:54 +01:00
import remarkGfm from "remark-gfm"
import remarkBreaks from "remark-breaks"
2025-02-14 18:11:45 +01:00
2025-02-13 23:04:40 +01:00
async function getChangelog() {
2025-02-14 17:31:44 +01:00
const changelogPath = path.join(process.cwd(), "..", "CHANGELOG.md")
2025-02-14 17:54:52 +01:00
try {
const fileContents = fs.readFileSync(changelogPath, "utf8")
2025-02-14 18:52:54 +01:00
return fileContents
2025-02-14 17:54:52 +01:00
} catch (error) {
console.error("Error reading changelog file:", error)
2025-02-14 18:21:58 +01:00
return "Changelog content not found."
2025-02-14 17:54:52 +01:00
}
2025-02-13 23:04:40 +01:00
}
export default async function ChangelogPage() {
const changelogContent = await getChangelog()
2025-02-14 12:24:18 +01:00
return (
2025-02-14 18:21:58 +01:00
<div className="bg-white text-gray-900 min-h-screen">
2025-02-14 17:54:52 +01:00
<div className="container mx-auto px-4 py-16 max-w-4xl">
<h1 className="text-4xl font-bold mb-8">Changelog</h1>
2025-02-14 18:31:15 +01:00
<div className="prose prose-lg max-w-none bg-gray-100 p-4 border border-gray-300 rounded-md">
2025-02-14 18:52:54 +01:00
<ReactMarkdown remarkPlugins={[remarkGfm, remarkBreaks]}>
{changelogContent}
</ReactMarkdown>
2025-02-14 18:31:15 +01:00
</div>
2025-02-14 17:54:52 +01:00
</div>
2025-02-13 23:04:40 +01:00
</div>
)
2025-02-14 17:09:21 +01:00
}