mirror of
https://git.aramjonghu.nl/AramJonghu/aramjonghu-site.git
synced 2026-06-06 17:18:24 +02:00
minor changes: (faulty)
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
|
||||
const fetchREADME = async (url) => {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
if (!response.ok) throw new Error("Failed to fetch README");
|
||||
return await response.text();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return "Error fetching README.";
|
||||
}
|
||||
};
|
||||
|
||||
export default function ProjectsReadme() {
|
||||
const [readmeContent, setReadmeContent] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
fetchREADME(
|
||||
// "https://git.aramjonghu.nl/AramJonghu/aramjonghu-site/src/branch/master/README.md",
|
||||
"../../../README.md",
|
||||
).then((content) => setReadmeContent(content));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2>README Content</h2>
|
||||
<ReactMarkdown>{readmeContent}</ReactMarkdown>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user