26 lines
689 B
TypeScript
Raw Permalink Normal View History

2024-10-27 21:11:45 +00:00
/* 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';
2024-08-11 12:34:16 +02:00
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} />
);
2024-08-11 12:34:16 +02:00
}