mirror of
https://github.com/Sosokker/B2D-Ventures.git
synced 2025-12-20 06:24:06 +01:00
feat: enhance Modal component to accept deal data and display in DataTable
This commit is contained in:
parent
a05aacca59
commit
b1fa74e8c6
@ -243,7 +243,15 @@ export default async function Portfolio({ params }: { params: { uid: string } })
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="mt-5 grid grid-flow-row-dense">
|
<CardContent className="mt-5 grid grid-flow-row-dense">
|
||||||
<RecentFunds data={latestDeals} />
|
<RecentFunds data={latestDeals} />
|
||||||
<div className="mt-5 flex justify-center">{deals && deals.length ? <Modal /> : undefined}</div>
|
<div className="mt-5 flex justify-center">
|
||||||
|
{deals && deals.length ? <Modal data={latestDeals.map((deal) => {
|
||||||
|
return {
|
||||||
|
name: deal.name,
|
||||||
|
amount: deal.amount,
|
||||||
|
date: deal.date,
|
||||||
|
};
|
||||||
|
})} /> : undefined}
|
||||||
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,16 +1,20 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import {
|
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogDescription,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
DialogTrigger,
|
|
||||||
} from "@/components/ui/dialog";
|
|
||||||
import { Button } from "./ui/button";
|
import { Button } from "./ui/button";
|
||||||
import { DataTable } from "./dataTable";
|
import { DataTable } from "./dataTable";
|
||||||
|
|
||||||
export function Modal() {
|
export type Payment = {
|
||||||
|
data?: {
|
||||||
|
name?: string;
|
||||||
|
amount?: number;
|
||||||
|
avatar?: string;
|
||||||
|
date?: Date;
|
||||||
|
logo_url?: string;
|
||||||
|
status?: string;
|
||||||
|
profile_url?: string;
|
||||||
|
}[];
|
||||||
|
};
|
||||||
|
export function Modal({ data }: { data: Payment[] }) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Dialog>
|
<Dialog>
|
||||||
@ -18,7 +22,7 @@ export function Modal() {
|
|||||||
<Button>View More</Button>
|
<Button>View More</Button>
|
||||||
</DialogTrigger>
|
</DialogTrigger>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
{/* <DataTable /> */}
|
<DataTable data={data} />
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user