File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,15 +19,12 @@ export default function Navigation({ hasDashboardAccess }: { hasDashboardAccess?
1919 < nav className = "border-ps" style = { { borderBottomWidth : '1px' } } >
2020 < div className = "container mx-auto p-4 md:px-6 md:py-4" >
2121 < div className = "flex gap-4 flex-col md:items-center" >
22- { /* Logo */ }
2322 < Link
2423 href = "/"
2524 className = "text-lg md:text-2xl font-bold text-ps-primary hover:opacity-80 transition-opacity"
2625 >
2726 Postscript
2827 </ Link >
29-
30- { /* Navigation Links */ }
3128 < div className = "flex gap-2 justify-start md:items-center md:gap-6" >
3229 { navItems . map ( ( item ) => {
3330 const isActive = pathname === item . href ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import Link from 'next/link';
33import { requireAuth } from '../actions/auth' ;
44import { fetchUserPrompts } from '../actions/prompt' ;
55import GenerateNewPrompt from '../components/GenerateNewPrompt' ;
6+ import { fetchUserSubscription } from '../actions/account' ;
67
78type Prompt = {
89 id : string ;
@@ -17,6 +18,8 @@ export default async function Prompt() {
1718 redirect ( '/' ) ;
1819 }
1920 const prompts = await fetchUserPrompts ( userId ) ;
21+ const subscription = await fetchUserSubscription ( ) ;
22+ const hasGeneratePromptAccess = subscription ?. planType === 'PLATINUM' ;
2023
2124 return (
2225 < div className = "min-h-screen bg-ps-primary" >
@@ -31,7 +34,9 @@ export default async function Prompt() {
3134 You may still respond to any open prompts. Click on any prompt to
3235 view details or write your entry.
3336 </ p >
34- < GenerateNewPrompt />
37+ { hasGeneratePromptAccess && (
38+ < GenerateNewPrompt />
39+ ) }
3540 </ div >
3641 < div className = "flex flex-col gap-2 space-y-4" >
3742 { prompts ?. length > 0 ? (
You can’t perform that action at this time.
0 commit comments