develop #3

Merged
behnam merged 39 commits from develop into main 2024-11-26 15:47:00 +00:00
3 changed files with 20 additions and 13 deletions
Showing only changes of commit 38f6a47f65 - Show all commits

View File

@ -1,6 +1,6 @@
import { LatestInvoicesSkeleton, RevenueChartSkeleton } from "@/app/dashboard/components/skeletons/skeletons"; import { LatestInvoicesSkeleton, RevenueChartSkeleton } from "@/app/dashboard/components/skeletons/skeletons";
import CardWrapper from "@/app/dashboard/components/cards/cards"; import CardWrapper from "@/app/dashboard/components/cards/cards";
import LatestInvoices from "@/app/dashboard/components/latest-invoices"; import LatestInvoices from "@/app/dashboard/components/latest-invoices/latest-invoices";
import RevenueChart from "@/app/dashboard/components/revenue-chart/revenue-chart"; import RevenueChart from "@/app/dashboard/components/revenue-chart/revenue-chart";
import { Suspense } from "react"; import { Suspense } from "react";

View File

@ -0,0 +1,5 @@
import fetchCustomerInvoicesUsecase from "@/feature/core/customer-invoice/domain/usecase/fetch-customer-invoices-usecase";
export default function latestInvoicesController() {
return fetchCustomerInvoicesUsecase()
}

View File

@ -1,19 +1,12 @@
import fetchCustomerInvoicesUsecase from '@/feature/core/customer-invoice/domain/usecase/fetch-customer-invoices-usecase'; import latestInvoicesController from '@/app/dashboard/components/latest-invoices/latest-invoices-controller';
import { ArrowPathIcon } from '@heroicons/react/24/outline'; import { ArrowPathIcon } from '@heroicons/react/24/outline';
import clsx from 'clsx'; import clsx from 'clsx';
import Image from 'next/image'; import Image from 'next/image';
export default async function LatestInvoices() { export default async function LatestInvoices() {
const latestInvoices = await fetchCustomerInvoicesUsecase(); const latestInvoices = await latestInvoicesController();
return ( const invoices = latestInvoices.map((invoice, i) => {
<div className="flex w-full flex-col md:col-span-4">
<h2 className="mb-4 text-xl md:text-2xl">
Latest Invoices
</h2>
<div className="flex grow flex-col justify-between rounded-xl bg-gray-50 p-4">
<div className="bg-white px-6">
{latestInvoices.map((invoice, i) => {
return ( return (
<div <div
key={invoice.id} key={invoice.id}
@ -48,7 +41,16 @@ export default async function LatestInvoices() {
</p> </p>
</div> </div>
); );
})} })
return (
<div className="flex w-full flex-col md:col-span-4">
<h2 className="mb-4 text-xl md:text-2xl">
Latest Invoices
</h2>
<div className="flex grow flex-col justify-between rounded-xl bg-gray-50 p-4">
<div className="bg-white px-6">
{invoices}
</div> </div>
<div className="flex items-center pb-2 pt-6"> <div className="flex items-center pb-2 pt-6">
<ArrowPathIcon className="h-5 w-5 text-gray-500" /> <ArrowPathIcon className="h-5 w-5 text-gray-500" />