File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { auth } from '@/lib/auth' ;
2+ import { freemius } from '@/lib/freemius' ;
3+ import { headers } from 'next/headers' ;
4+ import { redirect } from 'next/navigation' ;
5+ import { CustomerPortal } from '@/react-starter/components/customer-portal' ;
6+ import FSCheckoutProvider from '@/components/fs-checkout' ;
7+ import AppMain , { AppContent } from '@/components/app-main' ;
8+
9+ export default async function Billing ( ) {
10+ const session = await auth . api . getSession ( {
11+ headers : await headers ( ) ,
12+ } ) ;
13+
14+ if ( ! session ) {
15+ redirect ( '/login' ) ;
16+ }
17+
18+ const checkout = await freemius . checkout . create ( {
19+ user : session ?. user ,
20+ isSandbox : process . env . NODE_ENV !== 'production' ,
21+ } ) ;
22+
23+ return (
24+ < AppMain title = "Billing" isLoggedIn = { true } >
25+ < AppContent >
26+ < FSCheckoutProvider checkout = { checkout . serialize ( ) } >
27+ < CustomerPortal endpoint = { process . env . NEXT_PUBLIC_APP_URL ! + '/api/portal' } />
28+ </ FSCheckoutProvider >
29+ </ AppContent >
30+ </ AppMain >
31+ ) ;
32+ }
Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ const data = {
3636 } ,
3737 ] ,
3838 navFooterLoggedIn : [
39- // {
40- // title: 'Billing & Payments',
41- // url: '/billing',
42- // icon: IconReceipt,
43- // },
39+ {
40+ title : 'Billing & Payments' ,
41+ url : '/billing' ,
42+ icon : IconReceipt ,
43+ } ,
4444 {
4545 title : 'Credits & Topups' ,
4646 url : '/credits' ,
You can’t perform that action at this time.
0 commit comments