Tranga-Website/Website/modules/Footer.tsx

27 lines
882 B
TypeScript
Raw Normal View History

import React, {useEffect} from 'react';
import '../styles/footer.css';
2024-10-18 19:45:23 +02:00
import {Job} from './Job';
2024-10-18 02:10:58 +02:00
export default function Footer(){
2024-10-18 19:45:23 +02:00
const [MonitoringJobsCount, setMonitoringJobsCount] = React.useState(0);
const [AllJobsCount, setAllJobsCount] = React.useState(0);
const [RunningJobsCount, setRunningJobsCount] = React.useState(0);
function UpdateBackendState(){
Job.GetMonitoringJobs().then((jobs) => setMonitoringJobsCount(jobs.length));
Job.GetAllJobs().then((jobs) => setAllJobsCount(jobs.length));
Job.GetRunningJobs().then((jobs) => setRunningJobsCount(jobs.length));
}
useEffect(() => {
UpdateBackendState();
}, []);
2024-10-18 02:10:58 +02:00
return (
<footer>
2024-10-18 19:45:23 +02:00
<p>{MonitoringJobsCount}</p>
<p>{AllJobsCount}</p>
<p>{RunningJobsCount}</p>
2024-10-18 02:10:58 +02:00
<p id="madeWith">Made with Blåhaj 🦈</p>
</footer>)
}