2025-01-13 21:36:52 +01:00
|
|
|
/* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
|
2024-10-27 21:11:45 +00:00
|
|
|
|
2024-12-11 08:38:50 +01:00
|
|
|
'use client'
|
|
|
|
|
|
|
|
import { GlobalSummary as Summary } from '@/app/lib/definitions';
|
|
|
|
import { getSlug } from '@/app/lib/utils';
|
2024-11-10 21:13:17 +01:00
|
|
|
import GlobalSummary from '@/app/ui/dashboard/global-summary';
|
2024-12-11 08:38:50 +01:00
|
|
|
import { useEffect, useState } from 'react';
|
2024-11-10 21:13:17 +01:00
|
|
|
|
2024-08-11 12:34:16 +02:00
|
|
|
export default function Page() {
|
2024-12-11 08:38:50 +01:00
|
|
|
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-11-10 21:13:17 +01:00
|
|
|
);
|
2024-08-11 12:34:16 +02:00
|
|
|
}
|