11import { redirect } from "next/navigation" ;
22import { createClient } from "@/lib/supabase/server" ;
3- import { Sparkles , Rocket , Shield , User , Settings } from "lucide-react" ;
4- import Link from "next/link" ;
5- import { Button } from "@/components/ui/button" ;
6- import { Card , CardContent , CardDescription , CardHeader , CardTitle } from "@/components/ui/card" ;
3+ import { Sparkles , Rocket , Shield , User } from "lucide-react" ;
74import MembershipCard from "@/components/MembershipCard" ;
5+
6+ // Capitalization helper
7+ function capitalize ( word : string ) {
8+ return word . charAt ( 0 ) . toUpperCase ( ) + word . slice ( 1 ) . toLowerCase ( ) ;
9+ }
10+
811export default async function ProtectedPage ( ) {
912 const supabase = await createClient ( ) ;
1013
@@ -13,47 +16,27 @@ export default async function ProtectedPage() {
1316 redirect ( "/auth/signin" ) ;
1417 }
1518
16- const firstName = data . user . user_metadata ?. first_name || "" ;
17- const lastName = data . user . user_metadata ?. last_name || "" ;
19+ const firstNameRaw = data . user . user_metadata ?. first_name || "" ;
20+ const lastNameRaw = data . user . user_metadata ?. last_name || "" ;
21+
22+ const firstName = capitalize ( firstNameRaw ) ;
23+ const lastName = capitalize ( lastNameRaw ) ;
24+
1825 const displayName = firstName || lastName ? `${ firstName } ${ lastName } ` . trim ( ) : "there" ;
1926
2027 return (
2128 < div className = "flex-1 w-full flex flex-col gap-8 p-6 max-w-4xl mx-auto" >
22- < div >
23- < Link href = "/" className = "inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-zinc-900 text-white hover:bg-zinc-800 transition-colors shadow" >
24- ← Go Back
25- </ Link >
26- </ div >
2729 < div className = "relative overflow-hidden" >
2830 < div className = "absolute inset-0 bg-gradient-to-r from-blue-600/10 via-purple-600/10 to-pink-600/10 rounded-2xl" > </ div >
2931 < div className = "absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent rounded-2xl" > </ div >
30-
31- { /* <div className="relative bg-white/80 dark:bg-gray-900/80 backdrop-blur-sm border border-gray-200/50 dark:border-gray-700/50 p-6 rounded-2xl shadow-lg">
32- <div className="flex items-center gap-3 mb-4">
33- <div className="p-2 bg-green-100 dark:bg-green-900/30 rounded-lg">
34- <Shield className="h-5 w-5 text-green-600 dark:text-green-400" />
35- </div>
36- <div>
37- <h3 className="font-semibold text-green-800 dark:text-green-200">Protected Area</h3>
38- <p className="text-sm text-green-600 dark:text-green-400">Authentication verified</p>
39- </div>
40- </div>
41- <div className="flex gap-3 items-start">
42- <InfoIcon size="16" strokeWidth={2} className="text-green-600 dark:text-green-400 mt-0.5 flex-shrink-0" />
43- <p className="text-sm text-green-700 dark:text-green-300">
44- This is a protected page that you can only see as an authenticated user. Your session is secure and verified.
45- </p>
46- </div>
47- </div> */ }
4832 </ div >
4933
50-
5134 < div className = "space-y-6" >
5235 < div className = "text-center space-y-4" >
5336 < div className = "inline-flex items-center justify-center w-16 h-16 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full mb-4" >
5437 < User className = "h-8 w-8 text-white" />
5538 </ div >
56-
39+
5740 < div className = "space-y-2" >
5841 < h1 className = "text-4xl md:text-5xl font-bold bg-gradient-to-r from-gray-900 via-blue-800 to-purple-800 dark:from-white dark:via-blue-200 dark:to-purple-200 bg-clip-text text-transparent" >
5942 Welcome back, { displayName } !
@@ -69,7 +52,6 @@ export default async function ProtectedPage() {
6952 < MembershipCard uid = { data . user . id } />
7053 </ div >
7154
72-
7355 < div className = "relative group" >
7456 < div className = "absolute -inset-1 bg-gradient-to-r from-yellow-400 via-orange-500 to-red-500 rounded-2xl blur opacity-25 group-hover:opacity-40 transition duration-1000 group-hover:duration-200" > </ div >
7557 < div className = "relative bg-gradient-to-br from-yellow-50 via-orange-50 to-red-50 dark:from-yellow-900/20 dark:via-orange-900/20 dark:to-red-900/20 border border-yellow-200 dark:border-yellow-700/50 p-6 rounded-2xl" >
@@ -91,8 +73,8 @@ export default async function ProtectedPage() {
9173 < div className = "flex items-center gap-2 pt-2" >
9274 < div className = "flex space-x-1" >
9375 < div className = "w-2 h-2 bg-yellow-500 rounded-full animate-bounce" > </ div >
94- < div className = "w-2 h-2 bg-yellow-500 rounded-full animate-bounce" style = { { animationDelay : ' 0.1s' } } > </ div >
95- < div className = "w-2 h-2 bg-yellow-500 rounded-full animate-bounce" style = { { animationDelay : ' 0.2s' } } > </ div >
76+ < div className = "w-2 h-2 bg-yellow-500 rounded-full animate-bounce" style = { { animationDelay : " 0.1s" } } > </ div >
77+ < div className = "w-2 h-2 bg-yellow-500 rounded-full animate-bounce" style = { { animationDelay : " 0.2s" } } > </ div >
9678 </ div >
9779 < span className = "text-sm text-yellow-600 dark:text-yellow-400 font-medium" >
9880 Development in progress
@@ -103,28 +85,6 @@ export default async function ProtectedPage() {
10385 </ div >
10486 </ div >
10587
106-
107- { /* Profile Settings Card */ }
108- < Card className = "mb-8" >
109- < CardHeader >
110- < CardTitle className = "flex items-center gap-2" >
111- < Settings className = "h-5 w-5" />
112- Customize Your Profile
113- </ CardTitle >
114- < CardDescription >
115- Add your information, social links, and customize how others see you
116- </ CardDescription >
117- </ CardHeader >
118- < CardContent >
119- < Button asChild className = "w-full sm:w-auto" >
120- < Link href = "/protected/profile" className = "flex items-center gap-2" >
121- < Settings className = "h-4 w-4" />
122- Manage Profile
123- </ Link >
124- </ Button >
125- </ CardContent >
126- </ Card >
127-
12888 < div className = "grid md:grid-cols-3 gap-6 mt-12" >
12989 < div className = "group p-6 bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 hover:shadow-lg hover:border-blue-300 dark:hover:border-blue-600 transition-all duration-300" >
13090 < div className = "w-12 h-12 bg-blue-100 dark:bg-blue-900/30 rounded-lg flex items-center justify-center mb-4 group-hover:scale-110 transition-transform" >
0 commit comments