import type { BlitzPage } from "blitz"; import { useQuery } from "blitz"; import getMetrics from "../queries/get-metrics"; import Layout from "../components/layout"; const initialData = { phoneNumbers: 0, smsExchanged: 0, minutesCalled: 0, }; const OpenMetrics: BlitzPage = () => { const [metrics] = useQuery(getMetrics, {}, { suspense: false, initialData }); const { phoneNumbers, smsExchanged, minutesCalled } = metrics ?? initialData; return (
); }; function Card({ title, value }: { title: string; value: number | string }) { return (
{title}
{value}
); } OpenMetrics.getLayout = (page) => {page}; OpenMetrics.suppressFirstRenderFlicker = true; export default OpenMetrics;