fix: about page

This commit is contained in:
2025-03-12 10:09:45 +00:00
parent bc1d0512f8
commit 0584089d92
4 changed files with 14 additions and 23 deletions

View File

@ -1,29 +1,17 @@
import { useEffect, useState } from "react";
import { FormattedMessage } from "react-intl";
import Changelog from "@/../CHANGELOG.md";
import Changelog from "@/../CHANGELOG.md?raw";
import { Markdown } from "@/Components/Event/Markdown";
export function AboutPage() {
const [changelog, setChangelog] = useState("");
async function getChangelog() {
const res = await fetch(Changelog);
const content = await res.text();
setChangelog(content);
}
useEffect(() => {
getChangelog().catch(console.error);
}, []);
const version = document.querySelector("meta[name='application-name']")?.getAttribute("content");
return (
<div className="main-content p">
<h1>
<FormattedMessage defaultMessage="About" />
</h1>
Version: <b>{__SNORT_VERSION__}</b>
<Markdown content={changelog} tags={[]} />
Version: <b>{version?.split(":")?.at(1) ?? "unknown version"}</b>
<Markdown content={Changelog} tags={[]} />
</div>
);
}