Manuel Bustillo 7dbfbb76b7
All checks were successful
Playwright Tests / test (pull_request) Has been skipped
Check usage of free licenses / build-static-assets (pull_request) Successful in 18s
Add copyright notice / copyright_notice (pull_request) Successful in 20s
Load dashboard information from the backend
2024-12-11 08:38:50 +01:00

26 lines
689 B
TypeScript

/* Copyright (C) 2024 Manuel Bustillo*/
'use client'
import { GlobalSummary as Summary } from '@/app/lib/definitions';
import { getSlug } from '@/app/lib/utils';
import GlobalSummary from '@/app/ui/dashboard/global-summary';
import { useEffect, useState } from 'react';
export default function Page() {
const [globalSummary, setGlobalSummary] = useState<Summary | undefined>(undefined);
function refreshSummary() {
fetch(`/api/${getSlug()}/summary`)
.then((response) => response.json())
.then((data) => {
setGlobalSummary(data);
})
}
useEffect(refreshSummary, []);
return (
globalSummary && <GlobalSummary summary={globalSummary} />
);
}