Seth0330 commited on
Commit
ae6419f
·
verified ·
1 Parent(s): 4fd8339

Update frontend/src/Layout.jsx

Browse files
Files changed (1) hide show
  1. frontend/src/Layout.jsx +37 -1
frontend/src/Layout.jsx CHANGED
@@ -8,8 +8,11 @@ import {
8
  History as HistoryIcon,
9
  ChevronLeft,
10
  Sparkles,
 
 
11
  } from "lucide-react";
12
  import { cn } from "@/lib/utils";
 
13
 
14
  // Import logo - Vite will process this and handle the path correctly
15
  // For production, the logo should be in frontend/public/logo.png
@@ -18,6 +21,7 @@ const logoPath = "/logo.png";
18
 
19
  export default function Layout({ children, currentPageName }) {
20
  const [collapsed, setCollapsed] = useState(false);
 
21
 
22
  const navItems = [
23
  { name: "Dashboard", icon: LayoutDashboard, page: "Dashboard" },
@@ -110,6 +114,38 @@ export default function Layout({ children, currentPageName }) {
110
  </button>
111
  )}
112
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  {/* Pro Badge */}
114
  {!collapsed && (
115
  <div className="p-3">
@@ -119,7 +155,7 @@ export default function Layout({ children, currentPageName }) {
119
  <span className="text-xs font-semibold tracking-wide">DEPLOY CUSTOM AGENT</span>
120
  </div>
121
  <p className="text-xs text-slate-400 mb-3">
122
- Batch extractions, custom model, field mapping, complex lineitems, tables, workflows, &amp; API access
123
  </p>
124
  <button className="w-full py-2 px-3 rounded-lg bg-white text-slate-900 text-sm font-semibold hover:bg-slate-100 transition-colors">
125
  Book a Custom Demo
 
8
  History as HistoryIcon,
9
  ChevronLeft,
10
  Sparkles,
11
+ LogOut,
12
+ User,
13
  } from "lucide-react";
14
  import { cn } from "@/lib/utils";
15
+ import { useAuth } from "./contexts/AuthContext";
16
 
17
  // Import logo - Vite will process this and handle the path correctly
18
  // For production, the logo should be in frontend/public/logo.png
 
21
 
22
  export default function Layout({ children, currentPageName }) {
23
  const [collapsed, setCollapsed] = useState(false);
24
+ const { user, logout } = useAuth();
25
 
26
  const navItems = [
27
  { name: "Dashboard", icon: LayoutDashboard, page: "Dashboard" },
 
114
  </button>
115
  )}
116
 
117
+ {/* User Profile */}
118
+ {!collapsed && user && (
119
+ <div className="p-3 border-t border-slate-200">
120
+ <div className="flex items-center gap-3 p-3 rounded-xl bg-slate-50 hover:bg-slate-100 transition-colors">
121
+ {user.picture ? (
122
+ <img
123
+ src={user.picture}
124
+ alt={user.name || user.email}
125
+ className="h-10 w-10 rounded-lg object-cover"
126
+ />
127
+ ) : (
128
+ <div className="h-10 w-10 rounded-lg bg-indigo-100 flex items-center justify-center">
129
+ <User className="h-5 w-5 text-indigo-600" />
130
+ </div>
131
+ )}
132
+ <div className="flex-1 min-w-0">
133
+ <p className="text-sm font-medium text-slate-900 truncate">
134
+ {user.name || "User"}
135
+ </p>
136
+ <p className="text-xs text-slate-500 truncate">{user.email}</p>
137
+ </div>
138
+ </div>
139
+ <button
140
+ onClick={logout}
141
+ className="mt-2 w-full flex items-center gap-2 px-3 py-2 rounded-xl text-sm text-slate-600 hover:bg-red-50 hover:text-red-600 transition-colors"
142
+ >
143
+ <LogOut className="h-4 w-4" />
144
+ <span>Sign Out</span>
145
+ </button>
146
+ </div>
147
+ )}
148
+
149
  {/* Pro Badge */}
150
  {!collapsed && (
151
  <div className="p-3">
 
155
  <span className="text-xs font-semibold tracking-wide">DEPLOY CUSTOM AGENT</span>
156
  </div>
157
  <p className="text-xs text-slate-400 mb-3">
158
+ Batch extractions, custom model, field mapping, complex lineitems, tables, workflows, &amp; API access
159
  </p>
160
  <button className="w-full py-2 px-3 rounded-lg bg-white text-slate-900 text-sm font-semibold hover:bg-slate-100 transition-colors">
161
  Book a Custom Demo