11"use client" ;
22
33import { useState , useEffect } from "react" ;
4- import { Github , GitBranch , Code2 , ExternalLink , CheckCircle , Clock , XCircle , AlertCircle , FileText , Eye , GitCommit , Bell , Settings } from "lucide-react" ;
4+ import { Github , GitBranch , Code2 , ExternalLink , CheckCircle , Clock , XCircle , AlertCircle , FileText , Eye , GitCommit , Bell , Settings , LogOut , User } from "lucide-react" ;
55import Link from "next/link" ;
66import { Button } from "@/components/ui/button" ;
77import { Input } from "@/components/ui/input" ;
@@ -11,12 +11,16 @@ import { Badge } from "@/components/ui/badge";
1111import { Label } from "@/components/ui/label" ;
1212import { Separator } from "@/components/ui/separator" ;
1313import { Select , SelectContent , SelectItem , SelectTrigger , SelectValue } from "@/components/ui/select" ;
14+ import { DropdownMenu , DropdownMenuContent , DropdownMenuItem , DropdownMenuSeparator , DropdownMenuTrigger } from "@/components/ui/dropdown-menu" ;
1415import { Task } from "@/types" ;
1516import { formatDiff , parseDiffStats } from "@/lib/utils" ;
17+ import { ProtectedRoute } from "@/components/protected-route" ;
18+ import { useAuth } from "@/contexts/auth-context" ;
1619
1720
1821
1922export default function Home ( ) {
23+ const { user, signOut } = useAuth ( ) ;
2024 const [ prompt , setPrompt ] = useState ( "" ) ;
2125 const [ repoUrl , setRepoUrl ] = useState ( "https://github.com/ObservedObserver/streamlit-react" ) ;
2226 const [ branch , setBranch ] = useState ( "main" ) ;
@@ -200,7 +204,8 @@ export default function Home() {
200204 } ;
201205
202206 return (
203- < div className = "min-h-screen bg-gradient-to-br from-slate-50 to-slate-100" >
207+ < ProtectedRoute >
208+ < div className = "min-h-screen bg-gradient-to-br from-slate-50 to-slate-100" >
204209 { /* Notification Banner */ }
205210 { showNotification && (
206211 < div className = "bg-green-600 text-white px-6 py-3 text-center relative" >
@@ -230,15 +235,37 @@ export default function Home() {
230235 < p className = "text-sm text-slate-500" > Claude Code & Codex CLI Integration </ p >
231236 </ div >
232237 </ div >
233- < Link href = "/settings" >
234- < Button
235- variant = "outline"
236- className = "gap-2"
237- >
238- < Settings className = "w-4 h-4" />
239- Settings
240- </ Button >
241- </ Link >
238+ < div className = "flex items-center gap-4" >
239+ < Link href = "/settings" >
240+ < Button
241+ variant = "outline"
242+ className = "gap-2"
243+ >
244+ < Settings className = "w-4 h-4" />
245+ Settings
246+ </ Button >
247+ </ Link >
248+
249+ < DropdownMenu >
250+ < DropdownMenuTrigger asChild >
251+ < Button variant = "outline" className = "gap-2" >
252+ < User className = "w-4 h-4" />
253+ { user ?. email ?. split ( '@' ) [ 0 ] || 'User' }
254+ </ Button >
255+ </ DropdownMenuTrigger >
256+ < DropdownMenuContent align = "end" className = "w-56" >
257+ < div className = "p-2" >
258+ < p className = "text-sm font-medium" > { user ?. email } </ p >
259+ < p className = "text-xs text-slate-500" > Signed in</ p >
260+ </ div >
261+ < DropdownMenuSeparator />
262+ < DropdownMenuItem onClick = { signOut } className = "gap-2 text-red-600" >
263+ < LogOut className = "w-4 h-4" />
264+ Sign Out
265+ </ DropdownMenuItem >
266+ </ DropdownMenuContent >
267+ </ DropdownMenu >
268+ </ div >
242269 </ div >
243270 </ div >
244271 </ header >
@@ -540,5 +567,6 @@ export default function Home() {
540567 </ div >
541568 </ main >
542569 </ div >
570+ </ ProtectedRoute >
543571 ) ;
544572}
0 commit comments