-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.tsx
More file actions
31 lines (29 loc) · 952 Bytes
/
page.tsx
File metadata and controls
31 lines (29 loc) · 952 Bytes
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
import { getCurrentUser, getMyListings, getUsersFavorites } from "@/lib/actions";
import { ProfileHeader } from "@/components/profile/ProfileHeader";
import { ListingSection } from "@/components/profile/ListingSection";
export default async function ProfilePage() {
const [currentUser, myListings, savedPosts] = await Promise.all([
getCurrentUser(),
getMyListings(),
getUsersFavorites(),
]);
return (
<div className="container mx-auto w-full max-w-[96rem] space-y-8 px-4 pt-6 sm:px-12">
<ProfileHeader user={currentUser} />
<ListingSection
title="My Listings"
count={myListings.count}
listings={myListings.results}
seeAllHref="/profile/listings"
icon="listings"
/>
<ListingSection
title="Saved Posts"
count={savedPosts.count}
listings={savedPosts.results}
seeAllHref="/profile/saved"
icon="saved"
/>
</div>
);
}