aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/pages/About.tsx
blob: a5bb291dab8e1d4a9f122b2bf5c5f33a9e231506 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React from "react";
import ReactMarkdown from "react-markdown";
import { Helmet } from "react-helmet";

const About: React.FC = () => {
  const [aboutText, setAboutText] = React.useState<string>("");

  React.useEffect(() => {
    const fetchReadme = async () => {
      try {
        const response = await fetch(
          "https://raw.githubusercontent.com/pektezol/lphub/main/README.md"
        );
        if (!response.ok) {
          throw new Error("Failed to fetch README");
        }
        const readmeText = await response.text();
        setAboutText(readmeText);
      } catch (error) {
        console.error("Error fetching README:", error);
      }
    };
    fetchReadme();
  }, []);

  return (
    <div className="p-8 text-foreground font-[--font-barlow-semicondensed-regular] prose prose-invert max-w-none">
      <Helmet>
        <title>LPHUB | About</title>
      </Helmet>
      <ReactMarkdown>{aboutText}</ReactMarkdown>
    </div>
  );
};

export default About;