-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathpage.tsx
32 lines (29 loc) · 984 Bytes
/
page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { getServerSession } from "next-auth";
import { OnRampTransactions } from "../../../components/OnRampTransactions";
import { SendCard } from "../../../components/SendCard";
import { authOptions } from "../../lib/auth";
import prisma from "@repo/db/client";
import { time } from "console";
async function getP2pTranstions() {
const session = await getServerSession(authOptions);
const txns = await prisma.p2pTransfer.findMany({
where: {
fromUserId: Number(session?.user?.id)
}
});
return txns.map(t => ({
time: t.timestamp,
amount: t.amount,
status: "",
provider: ""
}))
}
export default async function() {
const transactions = await getP2pTranstions();
return <div className="grid grid-cols-1 gap-4 md:grid-cols-2 p-4 w-screen">
<SendCard />
<div className="flex items-center">
<OnRampTransactions transactions={transactions}/>
</div>
</div>
}