shared with me page logic

This commit is contained in:
Ishaan Dey
2024-05-01 02:49:25 -04:00
parent d3698b9a50
commit 1066638e92
4 changed files with 62 additions and 16 deletions

View File

@ -14,10 +14,21 @@ export default async function DashboardPage() {
const userRes = await fetch(`http://localhost:8787/api/user?id=${user.id}`)
const userData = (await userRes.json()) as User
const sharedRes = await fetch(
`http://localhost:8787/api/sandbox/share?id=${user.id}`
)
const shared = (await sharedRes.json()) as {
id: string
name: string
type: "react" | "node"
author: string
sharedOn: Date
}[]
return (
<div className="w-screen h-screen flex flex-col overflow-hidden overscroll-none">
<Navbar userData={userData} />
<Dashboard sandboxes={userData.sandbox} />
<Dashboard sandboxes={userData.sandbox} shared={shared} />
</div>
)
}