2024-10-27 21:11:45 +00:00
|
|
|
/* Copyright (C) 2024 Manuel Bustillo*/
|
|
|
|
|
2024-08-11 12:03:11 +02:00
|
|
|
import {
|
|
|
|
BanknotesIcon,
|
|
|
|
ClockIcon,
|
|
|
|
UserGroupIcon,
|
|
|
|
InboxIcon,
|
|
|
|
} from '@heroicons/react/24/outline';
|
|
|
|
import { lusitana } from '@/app/ui/fonts';
|
|
|
|
|
|
|
|
const iconMap = {
|
|
|
|
collected: BanknotesIcon,
|
|
|
|
customers: UserGroupIcon,
|
|
|
|
pending: ClockIcon,
|
2024-08-11 12:34:16 +02:00
|
|
|
guests: InboxIcon,
|
2024-08-11 12:03:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default async function CardWrapper() {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{/* NOTE: Uncomment this code in Chapter 9 */}
|
|
|
|
|
2024-08-11 12:34:16 +02:00
|
|
|
{/* <Card title="Collected" value={totalPaidguests} type="collected" />
|
|
|
|
<Card title="Pending" value={totalPendingguests} type="pending" />
|
|
|
|
<Card title="Total guests" value={numberOfguests} type="guests" />
|
2024-08-11 12:03:11 +02:00
|
|
|
<Card
|
|
|
|
title="Total Customers"
|
|
|
|
value={numberOfCustomers}
|
|
|
|
type="customers"
|
|
|
|
/> */}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function Card({
|
|
|
|
title,
|
|
|
|
value,
|
|
|
|
type,
|
|
|
|
}: {
|
|
|
|
title: string;
|
|
|
|
value: number | string;
|
2024-08-11 12:34:16 +02:00
|
|
|
type: 'guests' | 'customers' | 'pending' | 'collected';
|
2024-08-11 12:03:11 +02:00
|
|
|
}) {
|
|
|
|
const Icon = iconMap[type];
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="rounded-xl bg-gray-50 p-2 shadow-sm">
|
|
|
|
<div className="flex p-4">
|
|
|
|
{Icon ? <Icon className="h-5 w-5 text-gray-700" /> : null}
|
|
|
|
<h3 className="ml-2 text-sm font-medium">{title}</h3>
|
|
|
|
</div>
|
|
|
|
<p
|
|
|
|
className={`${lusitana.className}
|
|
|
|
truncate rounded-xl bg-white px-4 py-8 text-center text-2xl`}
|
|
|
|
>
|
|
|
|
{value}
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|