feat(changelog): added in a place to see the changelogs

This commit is contained in:
2025-04-13 10:40:31 -05:00
parent 9baeb1ceff
commit 242b90c75a
4 changed files with 84 additions and 5 deletions

View File

@@ -0,0 +1,33 @@
// src/components/Changelog.jsx
import { marked } from "marked";
import changelog from "../../../../CHANGELOG.md?raw"; // assuming changelog.md is in root
const Changelog = () => {
const html: any = marked.parse(changelog);
const recentChanges = html.split("<h2>")[1];
// const [htmlContent, setHtmlContent] = useState("");
// useEffect(() => {
// fetch("/changelog.md")
// .then((res) => res.text())
// .then((md) => {
// const versionBlocks = md.split(/^##\s+/gm); // Split on headings
// if (versionBlocks.length > 1) {
// const latestBlock = `## ${versionBlocks[1]}`;
// const html: any = marked.parse(latestBlock, {
// breaks: true,
// gfm: true,
// });
// setHtmlContent(html);
// }
// });
// }, []);
return (
<div
className="prose m-3"
dangerouslySetInnerHTML={{ __html: `<h2>${recentChanges}` }}
/>
);
};
export default Changelog;