diff --git a/app/dashboard/expenses/page.tsx b/app/dashboard/expenses/page.tsx index 91f6c0f..7e8cee5 100644 --- a/app/dashboard/expenses/page.tsx +++ b/app/dashboard/expenses/page.tsx @@ -1,12 +1,15 @@ /* Copyright (C) 2024 Manuel Bustillo*/ import { lusitana } from '@/app/ui/fonts'; +import ExpenseSummary from '@/app/ui/expenses/summary'; export default function Page () { return (
-
+

Expenses

+

Summary

+
); diff --git a/app/types.tsx b/app/types.tsx new file mode 100644 index 0000000..e561471 --- /dev/null +++ b/app/types.tsx @@ -0,0 +1,11 @@ +import * as HeroIcon from '@heroicons/react/24/outline' +import { ComponentProps } from 'react' + +type Props = { + name: keyof typeof HeroIcon +} & ComponentProps + +export const Icon = ({ name, ...props }: Props) => { + const IconComponent = HeroIcon[name] + return +} diff --git a/app/ui/components/dashboard-cards.tsx b/app/ui/components/dashboard-cards.tsx new file mode 100644 index 0000000..de16e00 --- /dev/null +++ b/app/ui/components/dashboard-cards.tsx @@ -0,0 +1,51 @@ +import clsx from "clsx" +import { Icon } from "../../types"; +import * as HeroIcon from '@heroicons/react/24/outline' + +type Style = "green" | "blue" | "red" | "orange" | "gray" + +const colorClasses = (style: Style) => { + switch (style) { + case "green": + return "bg-green-700 hover:bg-green-800" + case "blue": + return "bg-blue-500 hover:bg-blue-700" + case "red": + return "bg-red-600 hover:bg-red-700" + case "orange": + return "bg-orange-600 hover:bg-orange-700" + case "gray": + return "bg-gray-600 hover:bg-gray-700" + } +} + +export async function MainCard({ amount, title, subtitle, style, iconName }: + { + amount: string, + title: string, + subtitle?: string, + style: Style, + iconName: keyof typeof HeroIcon + }) { + + return ( +
+ +
+
{amount}
+
{title}
+
{subtitle || 'ㅤ'}
+
+
+ ); +} + +export async function SecondaryCard({ amount, title, iconName, style }: { amount: string, title: string, iconName: keyof typeof HeroIcon, style: Style }) { + return ( +
+ + {amount} + {title} +
+ ); +} \ No newline at end of file diff --git a/app/ui/expenses/summary.tsx b/app/ui/expenses/summary.tsx new file mode 100644 index 0000000..3f3015c --- /dev/null +++ b/app/ui/expenses/summary.tsx @@ -0,0 +1,43 @@ +import { MainCard, SecondaryCard } from '../components/dashboard-cards'; + +export default async function ExpenseSummary() { + return ( +
+ +
+ + +
+ + +
+
+ + +
+ +
+ +
+ + +
+ + +
+ +
+ + + +
+
+ +
+ + + +
+
+ ); +} \ No newline at end of file