Files
borrow-system/FrontendV2/src/components/Footer.tsx

44 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Box } from "@chakra-ui/react";
import { useEffect } from "react";
import { infoAtom } from "@/states/Atoms";
import { useAtom } from "jotai";
const API_BASE =
(import.meta as any).env?.VITE_BACKEND_URL ||
import.meta.env.VITE_BACKEND_URL ||
"http://localhost:8002";
export const Footer = () => {
const [info, setInfo] = useAtom(infoAtom);
useEffect(() => {
const metaData = async () => {
const response = await fetch(`${API_BASE}/server-info`, {
method: "GET",
});
if (response.ok) {
const data = await response.json();
setInfo(data);
}
};
metaData();
}, []);
return (
<Box
as="footer"
py={4}
textAlign="center"
position="fixed"
bottom="0"
left="0"
right="0"
>
Made with by Theis Gaedigk - Year 2019 at MCS-Bochum
<br />
Frontend-Version: {info ? info["frontend-info"].version : "N/A"} |
Backend-Version: {info ? info["backend-info"].version : "N/A"}
</Box>
);
};