From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Admin overview data display

Admin overview data display

All right, so we have our get order summary action. Now we want to create our overview page, our admin overview, which you should have the file created. If you've been following along, it's going to be app admin overview and then page.tsx. So if you don't have that, just create that page now. And then let's just add a page title. So I'm going to import metadata. And then we'll add, let's say, export const metadata and set that type to metadata. And for the title, I'm just going to say Admin Dashboard. So I'm kind of using Overview and Dashboard interchangeably. And then, let's see, we're going to want to do a couple of things above the return. Most of this is going to be adding the HTML and the ShadCN components, but we do want to get the session. So let's say cont session, and this has to be async because we're going to say session equals await and then auth. Make sure you bring that in. And the reason I'm getting the session is because I want to make sure that the user is an admin…

Contents