Manuel Bustillo 25703098d1
All checks were successful
Check usage of free licenses / build-static-assets (pull_request) Successful in 1m47s
Add copyright notice / copyright_notice (pull_request) Successful in 3m4s
Playwright Tests / test (pull_request) Successful in 6m8s
Build Nginx-based docker image / build-static-assets (pull_request) Successful in 11m35s
Check usage of free licenses / build-static-assets (push) Successful in 1m34s
Playwright Tests / test (push) Successful in 4m30s
Build Nginx-based docker image / build-static-assets (push) Successful in 17m58s
Add copyright notice
2024-10-27 21:11:45 +00:00

61 lines
1.4 KiB
TypeScript

/* Copyright (C) 2024 Manuel Bustillo*/
import {
BanknotesIcon,
ClockIcon,
UserGroupIcon,
InboxIcon,
} from '@heroicons/react/24/outline';
import { lusitana } from '@/app/ui/fonts';
const iconMap = {
collected: BanknotesIcon,
customers: UserGroupIcon,
pending: ClockIcon,
guests: InboxIcon,
};
export default async function CardWrapper() {
return (
<>
{/* NOTE: Uncomment this code in Chapter 9 */}
{/* <Card title="Collected" value={totalPaidguests} type="collected" />
<Card title="Pending" value={totalPendingguests} type="pending" />
<Card title="Total guests" value={numberOfguests} type="guests" />
<Card
title="Total Customers"
value={numberOfCustomers}
type="customers"
/> */}
</>
);
}
export function Card({
title,
value,
type,
}: {
title: string;
value: number | string;
type: 'guests' | 'customers' | 'pending' | 'collected';
}) {
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>
);
}