setup db connection + implement data fetching on dashboard + add skeleton + docs

This commit is contained in:
Michi 2025-04-19 17:56:12 +02:00
parent aea677e6f7
commit 00c39d3416
11 changed files with 259 additions and 67 deletions

View file

@ -5,6 +5,7 @@ import {
InboxIcon,
} from '@heroicons/react/24/outline';
import { lusitana } from '@/app/ui/fonts';
import { fetchCardData } from '@/app/lib/data';
const iconMap = {
collected: BanknotesIcon,
@ -14,18 +15,23 @@ const iconMap = {
};
export default async function CardWrapper() {
const {
numberOfInvoices,
numberOfCustomers,
totalPaidInvoices,
totalPendingInvoices,
} = await fetchCardData();
return (
<>
{/* NOTE: Uncomment this code in Chapter 9 */}
{/* <Card title="Collected" value={totalPaidInvoices} type="collected" />
<Card title="Collected" value={totalPaidInvoices} type="collected" />
<Card title="Pending" value={totalPendingInvoices} type="pending" />
<Card title="Total Invoices" value={numberOfInvoices} type="invoices" />
<Card
title="Total Customers"
value={numberOfCustomers}
type="customers"
/> */}
/>
</>
);
}