Spaces:
Sleeping
feat: improved light mode + language sync to html lang attribute
Browse files- globals.css: richer CSS variable system (--fg-muted, --fg-subtle, --card-hover,
--border-strong, --navbar-bg, --sidebar-bg, --ambient-*) with proper light mode values
- DashboardLayout: removed hardcoded bg-[#050505]/text-white, uses CSS vars + theme-aware ambient blobs
- Navbar: search input, divider, avatar all use CSS vars / isLight conditionals
- Sidebar: fully rewritten with CSS var system, improved lang dropdown with animation
- NotificationPanel: complete light mode overhaul, type-aware bg colors per mode
- page.tsx (dashboard): all hardcoded zinc/white colors replaced with CSS vars,
stat cards with light gradients, chart tick/grid colors adapt to theme
- AppShell: useEffect syncs document.documentElement.lang to BCP-47 code on lang change
- backend ai/chat + router + websocket: language param threaded through to AI backends
- backend/app/ai/chat.py +13 -12
- backend/app/ai/router.py +2 -1
- backend/app/websocket/router.py +2 -1
- frontend/src/app/globals.css +78 -24
- frontend/src/app/layout.tsx +7 -3
- frontend/src/app/page.tsx +157 -79
- frontend/src/components/layout/AppShell.tsx +16 -3
- frontend/src/components/layout/DashboardLayout.tsx +38 -14
- frontend/src/components/layout/Navbar.tsx +28 -7
- frontend/src/components/layout/Sidebar.tsx +179 -70
- frontend/src/components/notifications/NotificationPanel.tsx +99 -30
- frontend/src/lib/stores/languageStore.ts +66 -12
|
@@ -274,7 +274,7 @@ BEHAVIORAL ANALYSIS:
|
|
| 274 |
"""
|
| 275 |
return context
|
| 276 |
|
| 277 |
-
def get_contextual_system_prompt(db: Session, user_id: str) -> str:
|
| 278 |
"""
|
| 279 |
Constructs a highly specific system prompt containing the user's financial profile.
|
| 280 |
"""
|
|
@@ -288,6 +288,7 @@ CRITICAL RULES — NEVER BREAK THESE:
|
|
| 288 |
3. Be concise and specific — 2-5 sentences max. No generic advice.
|
| 289 |
4. If asked about balance, quote the exact figure. If asked about spending, reference actual transactions. If asked about goals, quote exact progress.
|
| 290 |
5. Speak like a personal banker who knows this client's finances intimately.
|
|
|
|
| 291 |
|
| 292 |
THIS USER'S LIVE FINANCIAL DATA:
|
| 293 |
{financial_context}
|
|
@@ -295,7 +296,7 @@ THIS USER'S LIVE FINANCIAL DATA:
|
|
| 295 |
You have read-only access to this data. Use it to answer every question with precision."""
|
| 296 |
return system_prompt
|
| 297 |
|
| 298 |
-
def get_offline_chat_fallback(db: Session, user_id: str, prompt: str) -> str:
|
| 299 |
"""
|
| 300 |
Generates a localized, rule-grounded financial analyst reply when AI engines are offline.
|
| 301 |
"""
|
|
@@ -330,7 +331,7 @@ def get_offline_chat_fallback(db: Session, user_id: str, prompt: str) -> str:
|
|
| 330 |
)
|
| 331 |
|
| 332 |
def get_chat_response(
|
| 333 |
-
db: Session, user_id: str, prompt: str, session_id: str | None = None
|
| 334 |
) -> tuple[str, str]:
|
| 335 |
"""
|
| 336 |
Returns (assistant reply, session_id) grounded in database context.
|
|
@@ -340,13 +341,13 @@ def get_chat_response(
|
|
| 340 |
session = chat_memory.ensure_session(db, user_id, session_id)
|
| 341 |
|
| 342 |
if not has_active_ai_backend():
|
| 343 |
-
fallback_msg = get_offline_chat_fallback(db, user_id, prompt)
|
| 344 |
chat_memory.add_message(db, session, user_id, "user", prompt)
|
| 345 |
chat_memory.add_message(db, session, user_id, "assistant", fallback_msg)
|
| 346 |
return fallback_msg, session.id
|
| 347 |
|
| 348 |
# Build full message list: system prompt with real account data + history + new message
|
| 349 |
-
sys_prompt = get_contextual_system_prompt(db, user_id)
|
| 350 |
history = chat_memory.get_history(db, session.id)
|
| 351 |
|
| 352 |
full_messages = [{"role": "system", "content": sys_prompt}]
|
|
@@ -391,19 +392,19 @@ def get_chat_response(
|
|
| 391 |
if not response_content:
|
| 392 |
try:
|
| 393 |
from app.ai.ollama_integration import get_ollama_response
|
| 394 |
-
response_content = get_ollama_response(prompt, history=history, language=
|
| 395 |
except Exception as e:
|
| 396 |
print(f"Ollama error in chat: {e}")
|
| 397 |
|
| 398 |
if not response_content:
|
| 399 |
-
response_content = get_offline_chat_fallback(db, user_id, prompt)
|
| 400 |
|
| 401 |
chat_memory.add_message(db, session, user_id, "user", prompt)
|
| 402 |
chat_memory.add_message(db, session, user_id, "assistant", response_content)
|
| 403 |
return response_content, session.id
|
| 404 |
|
| 405 |
def stream_chat_response(
|
| 406 |
-
db: Session, user_id: str, prompt: str, session_id: str | None = None
|
| 407 |
):
|
| 408 |
"""
|
| 409 |
Generates streaming chunks for WebSocket or HTTP SSE.
|
|
@@ -413,7 +414,7 @@ def stream_chat_response(
|
|
| 413 |
session = chat_memory.ensure_session(db, user_id, session_id)
|
| 414 |
|
| 415 |
if not has_active_ai_backend():
|
| 416 |
-
fallback_msg = get_offline_chat_fallback(db, user_id, prompt)
|
| 417 |
chat_memory.add_message(db, session, user_id, "user", prompt)
|
| 418 |
chat_memory.add_message(db, session, user_id, "assistant", fallback_msg)
|
| 419 |
import time
|
|
@@ -422,7 +423,7 @@ def stream_chat_response(
|
|
| 422 |
time.sleep(0.05)
|
| 423 |
return
|
| 424 |
|
| 425 |
-
sys_prompt = get_contextual_system_prompt(db, user_id)
|
| 426 |
history = chat_memory.get_history(db, session.id)
|
| 427 |
|
| 428 |
full_messages = [{"role": "system", "content": sys_prompt}]
|
|
@@ -481,13 +482,13 @@ def stream_chat_response(
|
|
| 481 |
|
| 482 |
try:
|
| 483 |
from app.ai.ollama_integration import stream_ollama_response
|
| 484 |
-
for chunk in stream_ollama_response(prompt, history=history, language=
|
| 485 |
if chunk:
|
| 486 |
complete_reply += chunk
|
| 487 |
yield chunk
|
| 488 |
chat_memory.add_message(db, session, user_id, "assistant", complete_reply)
|
| 489 |
except Exception as e:
|
| 490 |
print(f"Ollama streaming error: {e}")
|
| 491 |
-
fallback_msg = get_offline_chat_fallback(db, user_id, prompt)
|
| 492 |
yield fallback_msg
|
| 493 |
chat_memory.add_message(db, session, user_id, "assistant", fallback_msg)
|
|
|
|
| 274 |
"""
|
| 275 |
return context
|
| 276 |
|
| 277 |
+
def get_contextual_system_prompt(db: Session, user_id: str, language: str = "English") -> str:
|
| 278 |
"""
|
| 279 |
Constructs a highly specific system prompt containing the user's financial profile.
|
| 280 |
"""
|
|
|
|
| 288 |
3. Be concise and specific — 2-5 sentences max. No generic advice.
|
| 289 |
4. If asked about balance, quote the exact figure. If asked about spending, reference actual transactions. If asked about goals, quote exact progress.
|
| 290 |
5. Speak like a personal banker who knows this client's finances intimately.
|
| 291 |
+
6. ALWAYS communicate in {language}.
|
| 292 |
|
| 293 |
THIS USER'S LIVE FINANCIAL DATA:
|
| 294 |
{financial_context}
|
|
|
|
| 296 |
You have read-only access to this data. Use it to answer every question with precision."""
|
| 297 |
return system_prompt
|
| 298 |
|
| 299 |
+
def get_offline_chat_fallback(db: Session, user_id: str, prompt: str, language: str = "English") -> str:
|
| 300 |
"""
|
| 301 |
Generates a localized, rule-grounded financial analyst reply when AI engines are offline.
|
| 302 |
"""
|
|
|
|
| 331 |
)
|
| 332 |
|
| 333 |
def get_chat_response(
|
| 334 |
+
db: Session, user_id: str, prompt: str, session_id: str | None = None, language: str = "English"
|
| 335 |
) -> tuple[str, str]:
|
| 336 |
"""
|
| 337 |
Returns (assistant reply, session_id) grounded in database context.
|
|
|
|
| 341 |
session = chat_memory.ensure_session(db, user_id, session_id)
|
| 342 |
|
| 343 |
if not has_active_ai_backend():
|
| 344 |
+
fallback_msg = get_offline_chat_fallback(db, user_id, prompt, language=language)
|
| 345 |
chat_memory.add_message(db, session, user_id, "user", prompt)
|
| 346 |
chat_memory.add_message(db, session, user_id, "assistant", fallback_msg)
|
| 347 |
return fallback_msg, session.id
|
| 348 |
|
| 349 |
# Build full message list: system prompt with real account data + history + new message
|
| 350 |
+
sys_prompt = get_contextual_system_prompt(db, user_id, language=language)
|
| 351 |
history = chat_memory.get_history(db, session.id)
|
| 352 |
|
| 353 |
full_messages = [{"role": "system", "content": sys_prompt}]
|
|
|
|
| 392 |
if not response_content:
|
| 393 |
try:
|
| 394 |
from app.ai.ollama_integration import get_ollama_response
|
| 395 |
+
response_content = get_ollama_response(prompt, history=history, language=language)
|
| 396 |
except Exception as e:
|
| 397 |
print(f"Ollama error in chat: {e}")
|
| 398 |
|
| 399 |
if not response_content:
|
| 400 |
+
response_content = get_offline_chat_fallback(db, user_id, prompt, language=language)
|
| 401 |
|
| 402 |
chat_memory.add_message(db, session, user_id, "user", prompt)
|
| 403 |
chat_memory.add_message(db, session, user_id, "assistant", response_content)
|
| 404 |
return response_content, session.id
|
| 405 |
|
| 406 |
def stream_chat_response(
|
| 407 |
+
db: Session, user_id: str, prompt: str, session_id: str | None = None, language: str = "English"
|
| 408 |
):
|
| 409 |
"""
|
| 410 |
Generates streaming chunks for WebSocket or HTTP SSE.
|
|
|
|
| 414 |
session = chat_memory.ensure_session(db, user_id, session_id)
|
| 415 |
|
| 416 |
if not has_active_ai_backend():
|
| 417 |
+
fallback_msg = get_offline_chat_fallback(db, user_id, prompt, language=language)
|
| 418 |
chat_memory.add_message(db, session, user_id, "user", prompt)
|
| 419 |
chat_memory.add_message(db, session, user_id, "assistant", fallback_msg)
|
| 420 |
import time
|
|
|
|
| 423 |
time.sleep(0.05)
|
| 424 |
return
|
| 425 |
|
| 426 |
+
sys_prompt = get_contextual_system_prompt(db, user_id, language=language)
|
| 427 |
history = chat_memory.get_history(db, session.id)
|
| 428 |
|
| 429 |
full_messages = [{"role": "system", "content": sys_prompt}]
|
|
|
|
| 482 |
|
| 483 |
try:
|
| 484 |
from app.ai.ollama_integration import stream_ollama_response
|
| 485 |
+
for chunk in stream_ollama_response(prompt, history=history, language=language):
|
| 486 |
if chunk:
|
| 487 |
complete_reply += chunk
|
| 488 |
yield chunk
|
| 489 |
chat_memory.add_message(db, session, user_id, "assistant", complete_reply)
|
| 490 |
except Exception as e:
|
| 491 |
print(f"Ollama streaming error: {e}")
|
| 492 |
+
fallback_msg = get_offline_chat_fallback(db, user_id, prompt, language=language)
|
| 493 |
yield fallback_msg
|
| 494 |
chat_memory.add_message(db, session, user_id, "assistant", fallback_msg)
|
|
@@ -45,6 +45,7 @@ class SubscriptionSimulationRequest(BaseModel):
|
|
| 45 |
class ChatMessageRequest(BaseModel):
|
| 46 |
message: str
|
| 47 |
session_id: Optional[str] = None
|
|
|
|
| 48 |
|
| 49 |
class ChatSessionCreateRequest(BaseModel):
|
| 50 |
title: Optional[str] = "New chat"
|
|
@@ -249,7 +250,7 @@ def delete_chat_history(
|
|
| 249 |
@router.post("/chat")
|
| 250 |
def post_chat(req: ChatMessageRequest, user_id: Optional[str] = None, db: Session = Depends(get_db)):
|
| 251 |
uid = get_user_id_fallback(db, user_id)
|
| 252 |
-
response_msg, session_id = get_chat_response(db, uid, req.message, req.session_id)
|
| 253 |
return {"response": response_msg, "session_id": session_id}
|
| 254 |
|
| 255 |
|
|
|
|
| 45 |
class ChatMessageRequest(BaseModel):
|
| 46 |
message: str
|
| 47 |
session_id: Optional[str] = None
|
| 48 |
+
language: str = "English"
|
| 49 |
|
| 50 |
class ChatSessionCreateRequest(BaseModel):
|
| 51 |
title: Optional[str] = "New chat"
|
|
|
|
| 250 |
@router.post("/chat")
|
| 251 |
def post_chat(req: ChatMessageRequest, user_id: Optional[str] = None, db: Session = Depends(get_db)):
|
| 252 |
uid = get_user_id_fallback(db, user_id)
|
| 253 |
+
response_msg, session_id = get_chat_response(db, uid, req.message, req.session_id, req.language)
|
| 254 |
return {"response": response_msg, "session_id": session_id}
|
| 255 |
|
| 256 |
|
|
@@ -115,7 +115,8 @@ async def websocket_chat_endpoint(
|
|
| 115 |
|
| 116 |
try:
|
| 117 |
ws_session_id = payload.get("session_id")
|
| 118 |
-
|
|
|
|
| 119 |
if chunk:
|
| 120 |
await websocket.send_json({"type": "chat_chunk", "content": chunk})
|
| 121 |
except Exception as e:
|
|
|
|
| 115 |
|
| 116 |
try:
|
| 117 |
ws_session_id = payload.get("session_id")
|
| 118 |
+
ws_language = payload.get("language", "English")
|
| 119 |
+
for chunk in stream_chat_response(db, user_id, prompt, ws_session_id, language=ws_language):
|
| 120 |
if chunk:
|
| 121 |
await websocket.send_json({"type": "chat_chunk", "content": chunk})
|
| 122 |
except Exception as e:
|
|
@@ -8,19 +8,41 @@
|
|
| 8 |
--background: 0 0% 3%;
|
| 9 |
--foreground: 0 0% 98%;
|
| 10 |
--radius: 0.625rem;
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
--
|
| 14 |
-
--
|
| 15 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
}
|
| 17 |
|
| 18 |
html.light {
|
| 19 |
-
--bg:
|
| 20 |
-
--
|
| 21 |
-
--
|
| 22 |
-
--
|
| 23 |
-
--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
}
|
| 25 |
|
| 26 |
* { border-color: var(--border); box-sizing: border-box; }
|
|
@@ -28,7 +50,7 @@
|
|
| 28 |
body {
|
| 29 |
background-color: var(--bg);
|
| 30 |
color: var(--fg);
|
| 31 |
-
transition: background-color 0.
|
| 32 |
}
|
| 33 |
|
| 34 |
html { font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); }
|
|
@@ -41,44 +63,59 @@
|
|
| 41 |
}
|
| 42 |
|
| 43 |
.glass {
|
| 44 |
-
background:
|
| 45 |
backdrop-filter: blur(20px);
|
| 46 |
-webkit-backdrop-filter: blur(20px);
|
| 47 |
-
border: 1px solid
|
| 48 |
}
|
| 49 |
|
| 50 |
.glass-strong {
|
| 51 |
background: rgba(255, 255, 255, 0.10);
|
| 52 |
backdrop-filter: blur(32px);
|
| 53 |
-webkit-backdrop-filter: blur(32px);
|
| 54 |
-
border: 1px solid
|
|
|
|
|
|
|
|
|
|
| 55 |
}
|
| 56 |
|
| 57 |
.glass-card {
|
| 58 |
border-radius: 1rem;
|
| 59 |
-
background:
|
| 60 |
backdrop-filter: blur(20px);
|
| 61 |
-webkit-backdrop-filter: blur(20px);
|
| 62 |
-
border: 1px solid
|
| 63 |
-
box-shadow: 0 20px 40px rgba(0,
|
|
|
|
| 64 |
}
|
| 65 |
|
| 66 |
/* Light mode overrides */
|
| 67 |
html.light .glass-card {
|
| 68 |
-
background:
|
| 69 |
-
border: 1px solid
|
| 70 |
-
box-shadow: 0
|
| 71 |
}
|
| 72 |
html.light .glass {
|
| 73 |
-
background: rgba(255,255,255,0.
|
| 74 |
-
border: 1px solid
|
| 75 |
}
|
| 76 |
html.light .shimmer {
|
| 77 |
-
background: linear-gradient(90deg, rgba(
|
| 78 |
background-size: 200% 100%;
|
| 79 |
animation: shimmer 1.5s infinite;
|
| 80 |
}
|
| 81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
/* Gradient text */
|
| 83 |
.gradient-text {
|
| 84 |
background: linear-gradient(135deg, #60a5fa, #22d3ee, #34d399);
|
|
@@ -94,7 +131,7 @@
|
|
| 94 |
-webkit-text-fill-color: transparent;
|
| 95 |
}
|
| 96 |
|
| 97 |
-
/* Glow effects */
|
| 98 |
.glow-blue {
|
| 99 |
box-shadow: 0 0 30px rgba(59, 130, 246, 0.3), 0 0 60px rgba(59, 130, 246, 0.1);
|
| 100 |
}
|
|
@@ -104,6 +141,9 @@
|
|
| 104 |
.glow-purple {
|
| 105 |
box-shadow: 0 0 30px rgba(139, 92, 246, 0.3), 0 0 60px rgba(139, 92, 246, 0.1);
|
| 106 |
}
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
/* Streaming text cursor */
|
| 109 |
.streaming-cursor::after {
|
|
@@ -133,6 +173,14 @@
|
|
| 133 |
background-size: 200% 200%;
|
| 134 |
animation: gradient-shift 4s ease infinite;
|
| 135 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
}
|
| 137 |
|
| 138 |
/* ─── Custom scrollbar ───────────────────────────────────────────────────────── */
|
|
@@ -150,6 +198,12 @@
|
|
| 150 |
::-webkit-scrollbar-thumb:hover {
|
| 151 |
background: rgba(255, 255, 255, 0.2);
|
| 152 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
|
| 154 |
/* ─── Keyframes ──────────────────────────────────────────────────────────────── */
|
| 155 |
@keyframes blink {
|
|
|
|
| 8 |
--background: 0 0% 3%;
|
| 9 |
--foreground: 0 0% 98%;
|
| 10 |
--radius: 0.625rem;
|
| 11 |
+
|
| 12 |
+
/* Dark mode (default) */
|
| 13 |
+
--bg: #050505;
|
| 14 |
+
--bg-secondary:#0d0d0d;
|
| 15 |
+
--fg: #fafafa;
|
| 16 |
+
--fg-muted: #a1a1aa;
|
| 17 |
+
--fg-subtle: #71717a;
|
| 18 |
+
--card-bg: rgba(255,255,255,0.04);
|
| 19 |
+
--card-hover: rgba(255,255,255,0.06);
|
| 20 |
+
--border: rgba(255,255,255,0.08);
|
| 21 |
+
--border-strong: rgba(255,255,255,0.14);
|
| 22 |
+
--input-bg: rgba(255,255,255,0.05);
|
| 23 |
+
--navbar-bg: rgba(0,0,0,0.5);
|
| 24 |
+
--sidebar-bg: rgba(0,0,0,0.6);
|
| 25 |
+
--ambient-1: rgba(37,99,235,0.10);
|
| 26 |
+
--ambient-2: rgba(5,150,105,0.10);
|
| 27 |
+
--ambient-3: rgba(124,58,237,0.05);
|
| 28 |
}
|
| 29 |
|
| 30 |
html.light {
|
| 31 |
+
--bg: #f0f4f8;
|
| 32 |
+
--bg-secondary:#e8edf3;
|
| 33 |
+
--fg: #0f172a;
|
| 34 |
+
--fg-muted: #475569;
|
| 35 |
+
--fg-subtle: #94a3b8;
|
| 36 |
+
--card-bg: rgba(255,255,255,0.95);
|
| 37 |
+
--card-hover: rgba(255,255,255,1);
|
| 38 |
+
--border: rgba(15,23,42,0.10);
|
| 39 |
+
--border-strong: rgba(15,23,42,0.18);
|
| 40 |
+
--input-bg: rgba(255,255,255,0.9);
|
| 41 |
+
--navbar-bg: rgba(240,244,248,0.90);
|
| 42 |
+
--sidebar-bg: rgba(255,255,255,0.97);
|
| 43 |
+
--ambient-1: rgba(37,99,235,0.06);
|
| 44 |
+
--ambient-2: rgba(5,150,105,0.06);
|
| 45 |
+
--ambient-3: rgba(124,58,237,0.04);
|
| 46 |
}
|
| 47 |
|
| 48 |
* { border-color: var(--border); box-sizing: border-box; }
|
|
|
|
| 50 |
body {
|
| 51 |
background-color: var(--bg);
|
| 52 |
color: var(--fg);
|
| 53 |
+
transition: background-color 0.25s ease, color 0.25s ease;
|
| 54 |
}
|
| 55 |
|
| 56 |
html { font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); }
|
|
|
|
| 63 |
}
|
| 64 |
|
| 65 |
.glass {
|
| 66 |
+
background: var(--card-bg);
|
| 67 |
backdrop-filter: blur(20px);
|
| 68 |
-webkit-backdrop-filter: blur(20px);
|
| 69 |
+
border: 1px solid var(--border);
|
| 70 |
}
|
| 71 |
|
| 72 |
.glass-strong {
|
| 73 |
background: rgba(255, 255, 255, 0.10);
|
| 74 |
backdrop-filter: blur(32px);
|
| 75 |
-webkit-backdrop-filter: blur(32px);
|
| 76 |
+
border: 1px solid var(--border-strong);
|
| 77 |
+
}
|
| 78 |
+
html.light .glass-strong {
|
| 79 |
+
background: rgba(255,255,255,0.95);
|
| 80 |
}
|
| 81 |
|
| 82 |
.glass-card {
|
| 83 |
border-radius: 1rem;
|
| 84 |
+
background: var(--card-bg);
|
| 85 |
backdrop-filter: blur(20px);
|
| 86 |
-webkit-backdrop-filter: blur(20px);
|
| 87 |
+
border: 1px solid var(--border);
|
| 88 |
+
box-shadow: 0 20px 40px rgba(0,0,0,0.25);
|
| 89 |
+
transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
|
| 90 |
}
|
| 91 |
|
| 92 |
/* Light mode overrides */
|
| 93 |
html.light .glass-card {
|
| 94 |
+
background: var(--card-bg);
|
| 95 |
+
border: 1px solid var(--border);
|
| 96 |
+
box-shadow: 0 2px 16px rgba(15,23,42,0.08), 0 1px 4px rgba(15,23,42,0.06);
|
| 97 |
}
|
| 98 |
html.light .glass {
|
| 99 |
+
background: rgba(255,255,255,0.80);
|
| 100 |
+
border: 1px solid var(--border);
|
| 101 |
}
|
| 102 |
html.light .shimmer {
|
| 103 |
+
background: linear-gradient(90deg, rgba(15,23,42,0.04) 0%, rgba(15,23,42,0.09) 50%, rgba(15,23,42,0.04) 100%);
|
| 104 |
background-size: 200% 100%;
|
| 105 |
animation: shimmer 1.5s infinite;
|
| 106 |
}
|
| 107 |
|
| 108 |
+
/* ── Adaptive text helpers ── */
|
| 109 |
+
.text-adaptive {
|
| 110 |
+
color: var(--fg);
|
| 111 |
+
}
|
| 112 |
+
.text-adaptive-muted {
|
| 113 |
+
color: var(--fg-muted);
|
| 114 |
+
}
|
| 115 |
+
.text-adaptive-subtle {
|
| 116 |
+
color: var(--fg-subtle);
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
/* Gradient text */
|
| 120 |
.gradient-text {
|
| 121 |
background: linear-gradient(135deg, #60a5fa, #22d3ee, #34d399);
|
|
|
|
| 131 |
-webkit-text-fill-color: transparent;
|
| 132 |
}
|
| 133 |
|
| 134 |
+
/* Glow effects (toned down in light mode) */
|
| 135 |
.glow-blue {
|
| 136 |
box-shadow: 0 0 30px rgba(59, 130, 246, 0.3), 0 0 60px rgba(59, 130, 246, 0.1);
|
| 137 |
}
|
|
|
|
| 141 |
.glow-purple {
|
| 142 |
box-shadow: 0 0 30px rgba(139, 92, 246, 0.3), 0 0 60px rgba(139, 92, 246, 0.1);
|
| 143 |
}
|
| 144 |
+
html.light .glow-blue { box-shadow: 0 0 20px rgba(59,130,246,0.15); }
|
| 145 |
+
html.light .glow-emerald{ box-shadow: 0 0 20px rgba(16,185,129,0.15); }
|
| 146 |
+
html.light .glow-purple { box-shadow: 0 0 20px rgba(139,92,246,0.15); }
|
| 147 |
|
| 148 |
/* Streaming text cursor */
|
| 149 |
.streaming-cursor::after {
|
|
|
|
| 173 |
background-size: 200% 200%;
|
| 174 |
animation: gradient-shift 4s ease infinite;
|
| 175 |
}
|
| 176 |
+
|
| 177 |
+
/* ── Light mode chart / tooltip fixes ── */
|
| 178 |
+
html.light .recharts-cartesian-grid line {
|
| 179 |
+
stroke: rgba(15,23,42,0.07) !important;
|
| 180 |
+
}
|
| 181 |
+
html.light .recharts-text {
|
| 182 |
+
fill: #64748b !important;
|
| 183 |
+
}
|
| 184 |
}
|
| 185 |
|
| 186 |
/* ─── Custom scrollbar ───────────────────────────────────────────────────────── */
|
|
|
|
| 198 |
::-webkit-scrollbar-thumb:hover {
|
| 199 |
background: rgba(255, 255, 255, 0.2);
|
| 200 |
}
|
| 201 |
+
html.light ::-webkit-scrollbar-thumb {
|
| 202 |
+
background: rgba(15,23,42,0.15);
|
| 203 |
+
}
|
| 204 |
+
html.light ::-webkit-scrollbar-thumb:hover {
|
| 205 |
+
background: rgba(15,23,42,0.25);
|
| 206 |
+
}
|
| 207 |
|
| 208 |
/* ─── Keyframes ──────────────────────────────────────────────────────────────── */
|
| 209 |
@keyframes blink {
|
|
@@ -1,9 +1,12 @@
|
|
| 1 |
import type { Metadata } from "next";
|
| 2 |
-
import
|
| 3 |
import "./globals.css";
|
| 4 |
import { AppShell } from "@/components/layout/AppShell";
|
| 5 |
|
| 6 |
-
const
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
export const metadata: Metadata = {
|
| 9 |
title: "BankBot AI | Modern Banking",
|
|
@@ -14,8 +17,9 @@ export default function RootLayout({
|
|
| 14 |
children,
|
| 15 |
}: Readonly<{ children: React.ReactNode }>) {
|
| 16 |
return (
|
|
|
|
| 17 |
<html lang="en" className="dark">
|
| 18 |
-
<body className={`${
|
| 19 |
<AppShell>{children}</AppShell>
|
| 20 |
</body>
|
| 21 |
</html>
|
|
|
|
| 1 |
import type { Metadata } from "next";
|
| 2 |
+
import localFont from "next/font/local";
|
| 3 |
import "./globals.css";
|
| 4 |
import { AppShell } from "@/components/layout/AppShell";
|
| 5 |
|
| 6 |
+
const geistSans = localFont({
|
| 7 |
+
src: "./fonts/GeistVF.woff",
|
| 8 |
+
variable: "--font-sans",
|
| 9 |
+
});
|
| 10 |
|
| 11 |
export const metadata: Metadata = {
|
| 12 |
title: "BankBot AI | Modern Banking",
|
|
|
|
| 17 |
children,
|
| 18 |
}: Readonly<{ children: React.ReactNode }>) {
|
| 19 |
return (
|
| 20 |
+
// lang is updated client-side by AppShell via useEffect
|
| 21 |
<html lang="en" className="dark">
|
| 22 |
+
<body className={`${geistSans.variable} font-sans antialiased`}>
|
| 23 |
<AppShell>{children}</AppShell>
|
| 24 |
</body>
|
| 25 |
</html>
|
|
@@ -13,6 +13,8 @@ import {
|
|
| 13 |
} from "recharts";
|
| 14 |
import { useDashboardStore } from "@/lib/stores/dashboardStore";
|
| 15 |
import { useAuthStore } from "@/lib/stores/authStore";
|
|
|
|
|
|
|
| 16 |
import Link from "next/link";
|
| 17 |
|
| 18 |
// ─── Category colors ──────────────────────────────────────────────────────────
|
|
@@ -46,11 +48,11 @@ function CustomTooltip({ active, payload, label }: TooltipProps) {
|
|
| 46 |
if (!active || !payload?.length) return null;
|
| 47 |
return (
|
| 48 |
<div className="glass-card p-3 text-xs space-y-1 min-w-[140px]">
|
| 49 |
-
<p className="text-
|
| 50 |
{payload.map((entry) => (
|
| 51 |
<div key={entry.name} className="flex justify-between gap-4">
|
| 52 |
<span style={{ color: entry.color }}>{entry.name}</span>
|
| 53 |
-
<span className="text-
|
| 54 |
</div>
|
| 55 |
))}
|
| 56 |
</div>
|
|
@@ -65,40 +67,59 @@ interface StatCardProps {
|
|
| 65 |
positive?: boolean;
|
| 66 |
icon: React.ElementType;
|
| 67 |
gradient: string;
|
|
|
|
| 68 |
iconColor: string;
|
| 69 |
borderColor: string;
|
|
|
|
| 70 |
loading?: boolean;
|
|
|
|
| 71 |
}
|
| 72 |
-
function StatCard({
|
|
|
|
|
|
|
|
|
|
| 73 |
return (
|
| 74 |
<motion.div
|
| 75 |
variants={itemVariants}
|
| 76 |
whileHover={{ scale: 1.02, y: -2 }}
|
| 77 |
-
className={`relative overflow-hidden rounded-2xl border
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
>
|
| 79 |
-
<div className="absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300 bg-white/[0.
|
| 80 |
<div className="flex items-start justify-between">
|
| 81 |
<div>
|
| 82 |
-
<p className="text-xs font-medium
|
|
|
|
|
|
|
| 83 |
{loading ? (
|
| 84 |
<Skeleton className="mt-2 h-8 w-28" />
|
| 85 |
) : (
|
| 86 |
-
<p className="mt-2 text-2xl font-bold
|
|
|
|
|
|
|
| 87 |
)}
|
| 88 |
</div>
|
| 89 |
-
<div
|
|
|
|
|
|
|
|
|
|
| 90 |
<Icon className={`h-5 w-5 ${iconColor}`} />
|
| 91 |
</div>
|
| 92 |
</div>
|
| 93 |
{change && !loading && (
|
| 94 |
<div className="mt-4 flex items-center gap-1.5">
|
| 95 |
{positive ? (
|
| 96 |
-
<ArrowUpRight className="h-3.5 w-3.5 text-emerald-
|
| 97 |
) : (
|
| 98 |
-
<ArrowDownRight className="h-3.5 w-3.5 text-red-
|
| 99 |
)}
|
| 100 |
-
<span className={`text-xs font-semibold ${positive ? "text-emerald-
|
| 101 |
-
|
|
|
|
|
|
|
| 102 |
</div>
|
| 103 |
)}
|
| 104 |
</motion.div>
|
|
@@ -109,6 +130,13 @@ function StatCard({ title, value, change, positive, icon: Icon, gradient, iconCo
|
|
| 109 |
export default function Home() {
|
| 110 |
const { data, isLoading, error, fetch } = useDashboardStore();
|
| 111 |
const { user } = useAuthStore();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
useEffect(() => {
|
| 114 |
fetch();
|
|
@@ -118,9 +146,9 @@ export default function Home() {
|
|
| 118 |
|
| 119 |
const greeting = () => {
|
| 120 |
const h = new Date().getHours();
|
| 121 |
-
if (h < 12) return "
|
| 122 |
-
if (h < 17) return "
|
| 123 |
-
return "
|
| 124 |
};
|
| 125 |
|
| 126 |
const briefingText = data?.ai_briefing
|
|
@@ -145,11 +173,11 @@ export default function Home() {
|
|
| 145 |
>
|
| 146 |
{/* Header */}
|
| 147 |
<motion.div variants={itemVariants}>
|
| 148 |
-
<h1 className="text-3xl font-bold tracking-tight
|
| 149 |
{greeting()}, <span className="gradient-text">{firstName}</span> 👋
|
| 150 |
</h1>
|
| 151 |
-
<p className="
|
| 152 |
-
|
| 153 |
</p>
|
| 154 |
</motion.div>
|
| 155 |
|
|
@@ -157,13 +185,20 @@ export default function Home() {
|
|
| 157 |
{error && (
|
| 158 |
<motion.div
|
| 159 |
variants={itemVariants}
|
| 160 |
-
className=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
>
|
| 162 |
-
<AlertTriangle className="h-4 w-4 text-amber-
|
| 163 |
-
<p className="text-xs
|
| 164 |
-
<span className="text-amber-
|
| 165 |
-
<button
|
| 166 |
-
|
|
|
|
|
|
|
|
|
|
| 167 |
</button>
|
| 168 |
</p>
|
| 169 |
</motion.div>
|
|
@@ -172,11 +207,17 @@ export default function Home() {
|
|
| 172 |
{/* AI Briefing */}
|
| 173 |
<motion.div
|
| 174 |
variants={itemVariants}
|
| 175 |
-
className=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
>
|
| 177 |
<div className="relative flex items-center gap-3">
|
| 178 |
-
<div className=
|
| 179 |
-
|
|
|
|
|
|
|
| 180 |
</div>
|
| 181 |
<div className="flex-1 min-w-0">
|
| 182 |
{isLoading ? (
|
|
@@ -186,20 +227,22 @@ export default function Home() {
|
|
| 186 |
</>
|
| 187 |
) : (
|
| 188 |
<>
|
| 189 |
-
<p className="text-sm font-medium
|
| 190 |
-
|
| 191 |
-
<span className="text-emerald-
|
| 192 |
{briefingText?.slice(0, 100) || "Your financial health looks good today."}
|
| 193 |
</span>
|
| 194 |
</p>
|
| 195 |
-
<p className="text-xs
|
| 196 |
-
|
| 197 |
-
{data?.fraud_alert_count
|
|
|
|
|
|
|
| 198 |
</p>
|
| 199 |
</>
|
| 200 |
)}
|
| 201 |
</div>
|
| 202 |
-
<Link href="/chat" className="flex items-center gap-1 text-xs text-emerald-
|
| 203 |
Ask AI <ChevronRight className="h-3 w-3" />
|
| 204 |
</Link>
|
| 205 |
</div>
|
|
@@ -208,42 +251,54 @@ export default function Home() {
|
|
| 208 |
{/* Stat Cards */}
|
| 209 |
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
| 210 |
<StatCard
|
| 211 |
-
title="
|
| 212 |
value={data ? `$${data.total_balance.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}
|
| 213 |
icon={DollarSign}
|
| 214 |
gradient="from-blue-500/20 to-cyan-500/20"
|
| 215 |
-
|
|
|
|
| 216 |
borderColor="border-blue-500/20"
|
|
|
|
| 217 |
loading={isLoading}
|
|
|
|
| 218 |
/>
|
| 219 |
<StatCard
|
| 220 |
-
title="
|
| 221 |
value={data ? `$${data.monthly_income.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}
|
| 222 |
icon={TrendingUp}
|
| 223 |
gradient="from-emerald-500/20 to-teal-500/20"
|
| 224 |
-
|
|
|
|
| 225 |
borderColor="border-emerald-500/20"
|
|
|
|
| 226 |
loading={isLoading}
|
|
|
|
| 227 |
/>
|
| 228 |
<StatCard
|
| 229 |
-
title="
|
| 230 |
value={data ? `$${data.monthly_expenses.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}
|
| 231 |
icon={CreditCard}
|
| 232 |
gradient="from-orange-500/20 to-amber-500/20"
|
| 233 |
-
|
|
|
|
| 234 |
borderColor="border-orange-500/20"
|
|
|
|
| 235 |
loading={isLoading}
|
|
|
|
| 236 |
/>
|
| 237 |
<StatCard
|
| 238 |
-
title="
|
| 239 |
value={data ? `${data.savings_rate}%` : "—%"}
|
| 240 |
change={data ? `${data.savings_rate > 20 ? "+" : ""}${(data.savings_rate - 20).toFixed(1)}% vs target` : undefined}
|
| 241 |
positive={data ? data.savings_rate >= 20 : true}
|
| 242 |
icon={Activity}
|
| 243 |
gradient="from-purple-500/20 to-violet-500/20"
|
| 244 |
-
|
|
|
|
| 245 |
borderColor="border-purple-500/20"
|
|
|
|
| 246 |
loading={isLoading}
|
|
|
|
| 247 |
/>
|
| 248 |
</div>
|
| 249 |
|
|
@@ -253,18 +308,18 @@ export default function Home() {
|
|
| 253 |
<motion.div variants={itemVariants} className="col-span-4 glass-card p-6">
|
| 254 |
<div className="flex items-center justify-between mb-6">
|
| 255 |
<div>
|
| 256 |
-
<h2 className="text-base font-semibold
|
| 257 |
-
<p className="text-xs
|
| 258 |
</div>
|
| 259 |
<div className="flex gap-4 text-xs">
|
| 260 |
{[
|
| 261 |
-
{ label: "
|
| 262 |
-
{ label: "
|
| 263 |
-
{ label: "
|
| 264 |
].map((l) => (
|
| 265 |
<div key={l.label} className="flex items-center gap-1.5">
|
| 266 |
<div className="h-2 w-2 rounded-full" style={{ background: l.color }} />
|
| 267 |
-
<span
|
| 268 |
</div>
|
| 269 |
))}
|
| 270 |
</div>
|
|
@@ -281,14 +336,14 @@ export default function Home() {
|
|
| 281 |
{ id: "savingsGrad", color: "#3b82f6" },
|
| 282 |
].map(({ id, color }) => (
|
| 283 |
<linearGradient key={id} id={id} x1="0" y1="0" x2="0" y2="1">
|
| 284 |
-
<stop offset="5%" stopColor={color} stopOpacity={0.3} />
|
| 285 |
<stop offset="95%" stopColor={color} stopOpacity={0} />
|
| 286 |
</linearGradient>
|
| 287 |
))}
|
| 288 |
</defs>
|
| 289 |
-
<CartesianGrid strokeDasharray="3 3" stroke=
|
| 290 |
-
<XAxis dataKey="month" tick={{ fill:
|
| 291 |
-
<YAxis tick={{ fill:
|
| 292 |
<Tooltip content={<CustomTooltip />} />
|
| 293 |
<Area type="monotone" dataKey="income" stroke="#10b981" strokeWidth={2} fill="url(#incomeGrad)" />
|
| 294 |
<Area type="monotone" dataKey="expenses" stroke="#f59e0b" strokeWidth={2} fill="url(#expenseGrad)" />
|
|
@@ -301,8 +356,8 @@ export default function Home() {
|
|
| 301 |
{/* Spending Breakdown */}
|
| 302 |
<motion.div variants={itemVariants} className="col-span-3 glass-card p-6">
|
| 303 |
<div className="mb-4">
|
| 304 |
-
<h2 className="text-base font-semibold
|
| 305 |
-
<p className="text-xs
|
| 306 |
</div>
|
| 307 |
{isLoading ? (
|
| 308 |
<Skeleton className="h-[160px] w-full mb-4" />
|
|
@@ -310,7 +365,12 @@ export default function Home() {
|
|
| 310 |
<div className="flex items-center justify-center">
|
| 311 |
<ResponsiveContainer width="100%" height={160}>
|
| 312 |
<PieChart>
|
| 313 |
-
<Pie
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
{categoryData.map((entry, index) => (
|
| 315 |
<Cell key={index} fill={entry.color} stroke="transparent" />
|
| 316 |
))}
|
|
@@ -320,7 +380,9 @@ export default function Home() {
|
|
| 320 |
active && payload?.length ? (
|
| 321 |
<div className="glass-card p-2 text-xs">
|
| 322 |
<span style={{ color: payload[0].payload.color }}>{payload[0].name}</span>
|
| 323 |
-
<span className="
|
|
|
|
|
|
|
| 324 |
</div>
|
| 325 |
) : null
|
| 326 |
}
|
|
@@ -336,10 +398,13 @@ export default function Home() {
|
|
| 336 |
<div key={cat.name} className="flex items-center justify-between">
|
| 337 |
<div className="flex items-center gap-2">
|
| 338 |
<div className="h-2 w-2 rounded-full flex-shrink-0" style={{ background: cat.color }} />
|
| 339 |
-
<span className="text-xs
|
| 340 |
</div>
|
| 341 |
<div className="flex items-center gap-2">
|
| 342 |
-
<div
|
|
|
|
|
|
|
|
|
|
| 343 |
<div
|
| 344 |
className="h-full rounded-full"
|
| 345 |
style={{
|
|
@@ -348,7 +413,7 @@ export default function Home() {
|
|
| 348 |
}}
|
| 349 |
/>
|
| 350 |
</div>
|
| 351 |
-
<span className="text-xs font-medium
|
| 352 |
${cat.value.toLocaleString()}
|
| 353 |
</span>
|
| 354 |
</div>
|
|
@@ -362,11 +427,11 @@ export default function Home() {
|
|
| 362 |
<motion.div variants={itemVariants} className="glass-card p-6">
|
| 363 |
<div className="flex items-center justify-between mb-5">
|
| 364 |
<div>
|
| 365 |
-
<h2 className="text-base font-semibold
|
| 366 |
-
<p className="text-xs
|
| 367 |
</div>
|
| 368 |
-
<Link href="/transactions" className="flex items-center gap-1 text-xs text-emerald-
|
| 369 |
-
|
| 370 |
</Link>
|
| 371 |
</div>
|
| 372 |
<div className="space-y-1">
|
|
@@ -378,28 +443,37 @@ export default function Home() {
|
|
| 378 |
initial={{ opacity: 0, x: -10 }}
|
| 379 |
animate={{ opacity: 1, x: 0 }}
|
| 380 |
transition={{ delay: i * 0.05 }}
|
| 381 |
-
whileHover={{ backgroundColor: "rgba(255,255,255,0.03)" }}
|
| 382 |
className="flex items-center justify-between rounded-xl px-3 py-3 transition-colors cursor-pointer"
|
| 383 |
>
|
| 384 |
<div className="flex items-center gap-3">
|
| 385 |
-
<div
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 386 |
{tx.merchant.charAt(0).toUpperCase()}
|
| 387 |
</div>
|
| 388 |
<div>
|
| 389 |
-
<p className="text-sm font-medium
|
| 390 |
-
<p className="text-xs
|
| 391 |
{tx.category} · {tx.timestamp ? new Date(tx.timestamp).toLocaleDateString() : ""}
|
| 392 |
</p>
|
| 393 |
</div>
|
| 394 |
</div>
|
| 395 |
<div className="flex items-center gap-2">
|
| 396 |
-
<span className={`text-sm font-semibold ${tx.amount > 0 ? "text-emerald-
|
|
|
|
|
|
|
| 397 |
{tx.amount > 0 ? "+" : ""}${Math.abs(tx.amount).toFixed(2)}
|
| 398 |
</span>
|
| 399 |
{tx.amount > 0 ? (
|
| 400 |
-
<TrendingUp className="h-3.5 w-3.5 text-emerald-
|
| 401 |
) : (
|
| 402 |
-
<TrendingDown className="h-3.5 w-3.5
|
| 403 |
)}
|
| 404 |
</div>
|
| 405 |
</motion.div>
|
|
@@ -410,21 +484,25 @@ export default function Home() {
|
|
| 410 |
{/* Fraud Shield */}
|
| 411 |
<motion.div
|
| 412 |
variants={itemVariants}
|
| 413 |
-
className=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 414 |
>
|
| 415 |
-
<Shield className="h-4 w-4 text-emerald-
|
| 416 |
-
<p className="text-xs
|
| 417 |
-
<span className="text-emerald-
|
| 418 |
{data?.fraud_alert_count
|
| 419 |
-
? ` — ${data.fraud_alert_count}
|
| 420 |
-
:
|
| 421 |
</p>
|
| 422 |
{data?.fraud_alert_count ? (
|
| 423 |
-
<Link href="/security" className="ml-auto text-xs text-red-
|
| 424 |
-
|
| 425 |
</Link>
|
| 426 |
) : null}
|
| 427 |
</motion.div>
|
| 428 |
</motion.div>
|
| 429 |
);
|
| 430 |
-
}
|
|
|
|
| 13 |
} from "recharts";
|
| 14 |
import { useDashboardStore } from "@/lib/stores/dashboardStore";
|
| 15 |
import { useAuthStore } from "@/lib/stores/authStore";
|
| 16 |
+
import { useLanguageStore } from "@/lib/stores/languageStore";
|
| 17 |
+
import { useThemeStore } from "@/lib/stores/themeStore";
|
| 18 |
import Link from "next/link";
|
| 19 |
|
| 20 |
// ─── Category colors ──────────────────────────────────────────────────────────
|
|
|
|
| 48 |
if (!active || !payload?.length) return null;
|
| 49 |
return (
|
| 50 |
<div className="glass-card p-3 text-xs space-y-1 min-w-[140px]">
|
| 51 |
+
<p className="text-adaptive-muted font-medium mb-2">{label}</p>
|
| 52 |
{payload.map((entry) => (
|
| 53 |
<div key={entry.name} className="flex justify-between gap-4">
|
| 54 |
<span style={{ color: entry.color }}>{entry.name}</span>
|
| 55 |
+
<span className="text-adaptive font-semibold">${entry.value.toLocaleString()}</span>
|
| 56 |
</div>
|
| 57 |
))}
|
| 58 |
</div>
|
|
|
|
| 67 |
positive?: boolean;
|
| 68 |
icon: React.ElementType;
|
| 69 |
gradient: string;
|
| 70 |
+
lightGradient: string;
|
| 71 |
iconColor: string;
|
| 72 |
borderColor: string;
|
| 73 |
+
lightBorderColor: string;
|
| 74 |
loading?: boolean;
|
| 75 |
+
isLight: boolean;
|
| 76 |
}
|
| 77 |
+
function StatCard({
|
| 78 |
+
title, value, change, positive, icon: Icon,
|
| 79 |
+
gradient, lightGradient, iconColor, borderColor, lightBorderColor, loading, isLight
|
| 80 |
+
}: StatCardProps) {
|
| 81 |
return (
|
| 82 |
<motion.div
|
| 83 |
variants={itemVariants}
|
| 84 |
whileHover={{ scale: 1.02, y: -2 }}
|
| 85 |
+
className={`relative overflow-hidden rounded-2xl border backdrop-blur-xl p-6 cursor-pointer group ${
|
| 86 |
+
isLight
|
| 87 |
+
? `bg-gradient-to-br ${lightGradient} ${lightBorderColor}`
|
| 88 |
+
: `bg-gradient-to-br ${gradient} ${borderColor}`
|
| 89 |
+
}`}
|
| 90 |
>
|
| 91 |
+
<div className="absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300 bg-white/[0.03]" />
|
| 92 |
<div className="flex items-start justify-between">
|
| 93 |
<div>
|
| 94 |
+
<p className="text-xs font-medium uppercase tracking-wider" style={{ color: "var(--fg-subtle)" }}>
|
| 95 |
+
{title}
|
| 96 |
+
</p>
|
| 97 |
{loading ? (
|
| 98 |
<Skeleton className="mt-2 h-8 w-28" />
|
| 99 |
) : (
|
| 100 |
+
<p className="mt-2 text-2xl font-bold tracking-tight" style={{ color: "var(--fg)" }}>
|
| 101 |
+
{value}
|
| 102 |
+
</p>
|
| 103 |
)}
|
| 104 |
</div>
|
| 105 |
+
<div
|
| 106 |
+
className="flex h-10 w-10 items-center justify-center rounded-xl border"
|
| 107 |
+
style={{ background: "var(--card-bg)", borderColor: "var(--border-strong)" }}
|
| 108 |
+
>
|
| 109 |
<Icon className={`h-5 w-5 ${iconColor}`} />
|
| 110 |
</div>
|
| 111 |
</div>
|
| 112 |
{change && !loading && (
|
| 113 |
<div className="mt-4 flex items-center gap-1.5">
|
| 114 |
{positive ? (
|
| 115 |
+
<ArrowUpRight className="h-3.5 w-3.5 text-emerald-500" />
|
| 116 |
) : (
|
| 117 |
+
<ArrowDownRight className="h-3.5 w-3.5 text-red-500" />
|
| 118 |
)}
|
| 119 |
+
<span className={`text-xs font-semibold ${positive ? "text-emerald-500" : "text-red-500"}`}>
|
| 120 |
+
{change}
|
| 121 |
+
</span>
|
| 122 |
+
<span className="text-xs" style={{ color: "var(--fg-subtle)" }}>vs last month</span>
|
| 123 |
</div>
|
| 124 |
)}
|
| 125 |
</motion.div>
|
|
|
|
| 130 |
export default function Home() {
|
| 131 |
const { data, isLoading, error, fetch } = useDashboardStore();
|
| 132 |
const { user } = useAuthStore();
|
| 133 |
+
const { t } = useLanguageStore();
|
| 134 |
+
const { theme } = useThemeStore();
|
| 135 |
+
const isLight = theme === "light";
|
| 136 |
+
|
| 137 |
+
// Recharts axis tick color
|
| 138 |
+
const tickColor = isLight ? "#64748b" : "#71717a";
|
| 139 |
+
const gridColor = isLight ? "rgba(15,23,42,0.07)" : "rgba(255,255,255,0.05)";
|
| 140 |
|
| 141 |
useEffect(() => {
|
| 142 |
fetch();
|
|
|
|
| 146 |
|
| 147 |
const greeting = () => {
|
| 148 |
const h = new Date().getHours();
|
| 149 |
+
if (h < 12) return t("good_morning");
|
| 150 |
+
if (h < 17) return t("good_afternoon");
|
| 151 |
+
return t("good_evening");
|
| 152 |
};
|
| 153 |
|
| 154 |
const briefingText = data?.ai_briefing
|
|
|
|
| 173 |
>
|
| 174 |
{/* Header */}
|
| 175 |
<motion.div variants={itemVariants}>
|
| 176 |
+
<h1 className="text-3xl font-bold tracking-tight" style={{ color: "var(--fg)" }}>
|
| 177 |
{greeting()}, <span className="gradient-text">{firstName}</span> 👋
|
| 178 |
</h1>
|
| 179 |
+
<p className="mt-1 text-sm" style={{ color: "var(--fg-muted)" }}>
|
| 180 |
+
{t("financial_overview")}
|
| 181 |
</p>
|
| 182 |
</motion.div>
|
| 183 |
|
|
|
|
| 185 |
{error && (
|
| 186 |
<motion.div
|
| 187 |
variants={itemVariants}
|
| 188 |
+
className={`flex items-center gap-3 rounded-2xl border px-5 py-3 ${
|
| 189 |
+
isLight
|
| 190 |
+
? "border-amber-300/60 bg-amber-50"
|
| 191 |
+
: "border-amber-500/20 bg-amber-500/5"
|
| 192 |
+
}`}
|
| 193 |
>
|
| 194 |
+
<AlertTriangle className="h-4 w-4 text-amber-500 flex-shrink-0" />
|
| 195 |
+
<p className="text-xs" style={{ color: "var(--fg-muted)" }}>
|
| 196 |
+
<span className="text-amber-500 font-medium">{t("backend_offline")}</span> — {t("showing_cached")}{" "}
|
| 197 |
+
<button
|
| 198 |
+
onClick={() => fetch(undefined, true)}
|
| 199 |
+
className="underline hover:text-emerald-500 transition-colors"
|
| 200 |
+
>
|
| 201 |
+
{t("retry")}
|
| 202 |
</button>
|
| 203 |
</p>
|
| 204 |
</motion.div>
|
|
|
|
| 207 |
{/* AI Briefing */}
|
| 208 |
<motion.div
|
| 209 |
variants={itemVariants}
|
| 210 |
+
className={`relative overflow-hidden rounded-2xl border p-4 ${
|
| 211 |
+
isLight
|
| 212 |
+
? "border-emerald-300/50 bg-gradient-to-r from-emerald-50 via-cyan-50/50 to-blue-50"
|
| 213 |
+
: "border-emerald-500/20 bg-gradient-to-r from-emerald-500/10 via-cyan-500/5 to-blue-500/10"
|
| 214 |
+
}`}
|
| 215 |
>
|
| 216 |
<div className="relative flex items-center gap-3">
|
| 217 |
+
<div className={`flex h-9 w-9 items-center justify-center rounded-xl border flex-shrink-0 ${
|
| 218 |
+
isLight ? "bg-emerald-100 border-emerald-200" : "bg-emerald-500/20 border-emerald-500/30"
|
| 219 |
+
}`}>
|
| 220 |
+
<Sparkles className="h-4 w-4 text-emerald-500" />
|
| 221 |
</div>
|
| 222 |
<div className="flex-1 min-w-0">
|
| 223 |
{isLoading ? (
|
|
|
|
| 227 |
</>
|
| 228 |
) : (
|
| 229 |
<>
|
| 230 |
+
<p className="text-sm font-medium" style={{ color: "var(--fg)" }}>
|
| 231 |
+
{t("ai_daily_briefing")}{" "}
|
| 232 |
+
<span className="text-emerald-500">
|
| 233 |
{briefingText?.slice(0, 100) || "Your financial health looks good today."}
|
| 234 |
</span>
|
| 235 |
</p>
|
| 236 |
+
<p className="text-xs mt-0.5" style={{ color: "var(--fg-muted)" }}>
|
| 237 |
+
{t("health_score")} {data?.health_score ?? "—"}/100
|
| 238 |
+
{data?.fraud_alert_count
|
| 239 |
+
? ` · ${data.fraud_alert_count} fraud alert(s)`
|
| 240 |
+
: ` · ${t("no_fraud_alerts")}`}
|
| 241 |
</p>
|
| 242 |
</>
|
| 243 |
)}
|
| 244 |
</div>
|
| 245 |
+
<Link href="/chat" className="flex items-center gap-1 text-xs text-emerald-500 hover:text-emerald-400 transition-colors whitespace-nowrap">
|
| 246 |
Ask AI <ChevronRight className="h-3 w-3" />
|
| 247 |
</Link>
|
| 248 |
</div>
|
|
|
|
| 251 |
{/* Stat Cards */}
|
| 252 |
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
| 253 |
<StatCard
|
| 254 |
+
title={t("total_balance")}
|
| 255 |
value={data ? `$${data.total_balance.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}
|
| 256 |
icon={DollarSign}
|
| 257 |
gradient="from-blue-500/20 to-cyan-500/20"
|
| 258 |
+
lightGradient="from-blue-50 to-cyan-50"
|
| 259 |
+
iconColor="text-blue-500"
|
| 260 |
borderColor="border-blue-500/20"
|
| 261 |
+
lightBorderColor="border-blue-200/70"
|
| 262 |
loading={isLoading}
|
| 263 |
+
isLight={isLight}
|
| 264 |
/>
|
| 265 |
<StatCard
|
| 266 |
+
title={t("monthly_income")}
|
| 267 |
value={data ? `$${data.monthly_income.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}
|
| 268 |
icon={TrendingUp}
|
| 269 |
gradient="from-emerald-500/20 to-teal-500/20"
|
| 270 |
+
lightGradient="from-emerald-50 to-teal-50"
|
| 271 |
+
iconColor="text-emerald-500"
|
| 272 |
borderColor="border-emerald-500/20"
|
| 273 |
+
lightBorderColor="border-emerald-200/70"
|
| 274 |
loading={isLoading}
|
| 275 |
+
isLight={isLight}
|
| 276 |
/>
|
| 277 |
<StatCard
|
| 278 |
+
title={t("monthly_spend")}
|
| 279 |
value={data ? `$${data.monthly_expenses.toLocaleString("en-US", { minimumFractionDigits: 2 })}` : "$—"}
|
| 280 |
icon={CreditCard}
|
| 281 |
gradient="from-orange-500/20 to-amber-500/20"
|
| 282 |
+
lightGradient="from-orange-50 to-amber-50"
|
| 283 |
+
iconColor="text-orange-500"
|
| 284 |
borderColor="border-orange-500/20"
|
| 285 |
+
lightBorderColor="border-orange-200/70"
|
| 286 |
loading={isLoading}
|
| 287 |
+
isLight={isLight}
|
| 288 |
/>
|
| 289 |
<StatCard
|
| 290 |
+
title={t("savings_rate")}
|
| 291 |
value={data ? `${data.savings_rate}%` : "—%"}
|
| 292 |
change={data ? `${data.savings_rate > 20 ? "+" : ""}${(data.savings_rate - 20).toFixed(1)}% vs target` : undefined}
|
| 293 |
positive={data ? data.savings_rate >= 20 : true}
|
| 294 |
icon={Activity}
|
| 295 |
gradient="from-purple-500/20 to-violet-500/20"
|
| 296 |
+
lightGradient="from-purple-50 to-violet-50"
|
| 297 |
+
iconColor="text-purple-500"
|
| 298 |
borderColor="border-purple-500/20"
|
| 299 |
+
lightBorderColor="border-purple-200/70"
|
| 300 |
loading={isLoading}
|
| 301 |
+
isLight={isLight}
|
| 302 |
/>
|
| 303 |
</div>
|
| 304 |
|
|
|
|
| 308 |
<motion.div variants={itemVariants} className="col-span-4 glass-card p-6">
|
| 309 |
<div className="flex items-center justify-between mb-6">
|
| 310 |
<div>
|
| 311 |
+
<h2 className="text-base font-semibold" style={{ color: "var(--fg)" }}>{t("cash_flow")}</h2>
|
| 312 |
+
<p className="text-xs mt-0.5" style={{ color: "var(--fg-muted)" }}>{t("income_vs_expenses")}</p>
|
| 313 |
</div>
|
| 314 |
<div className="flex gap-4 text-xs">
|
| 315 |
{[
|
| 316 |
+
{ label: t("income"), color: "#10b981" },
|
| 317 |
+
{ label: t("expenses"), color: "#f59e0b" },
|
| 318 |
+
{ label: t("savings"), color: "#3b82f6" },
|
| 319 |
].map((l) => (
|
| 320 |
<div key={l.label} className="flex items-center gap-1.5">
|
| 321 |
<div className="h-2 w-2 rounded-full" style={{ background: l.color }} />
|
| 322 |
+
<span style={{ color: "var(--fg-muted)" }}>{l.label}</span>
|
| 323 |
</div>
|
| 324 |
))}
|
| 325 |
</div>
|
|
|
|
| 336 |
{ id: "savingsGrad", color: "#3b82f6" },
|
| 337 |
].map(({ id, color }) => (
|
| 338 |
<linearGradient key={id} id={id} x1="0" y1="0" x2="0" y2="1">
|
| 339 |
+
<stop offset="5%" stopColor={color} stopOpacity={isLight ? 0.15 : 0.3} />
|
| 340 |
<stop offset="95%" stopColor={color} stopOpacity={0} />
|
| 341 |
</linearGradient>
|
| 342 |
))}
|
| 343 |
</defs>
|
| 344 |
+
<CartesianGrid strokeDasharray="3 3" stroke={gridColor} />
|
| 345 |
+
<XAxis dataKey="month" tick={{ fill: tickColor, fontSize: 11 }} axisLine={false} tickLine={false} />
|
| 346 |
+
<YAxis tick={{ fill: tickColor, fontSize: 11 }} axisLine={false} tickLine={false} />
|
| 347 |
<Tooltip content={<CustomTooltip />} />
|
| 348 |
<Area type="monotone" dataKey="income" stroke="#10b981" strokeWidth={2} fill="url(#incomeGrad)" />
|
| 349 |
<Area type="monotone" dataKey="expenses" stroke="#f59e0b" strokeWidth={2} fill="url(#expenseGrad)" />
|
|
|
|
| 356 |
{/* Spending Breakdown */}
|
| 357 |
<motion.div variants={itemVariants} className="col-span-3 glass-card p-6">
|
| 358 |
<div className="mb-4">
|
| 359 |
+
<h2 className="text-base font-semibold" style={{ color: "var(--fg)" }}>{t("spending_breakdown")}</h2>
|
| 360 |
+
<p className="text-xs mt-0.5" style={{ color: "var(--fg-muted)" }}>{t("this_month_by_category")}</p>
|
| 361 |
</div>
|
| 362 |
{isLoading ? (
|
| 363 |
<Skeleton className="h-[160px] w-full mb-4" />
|
|
|
|
| 365 |
<div className="flex items-center justify-center">
|
| 366 |
<ResponsiveContainer width="100%" height={160}>
|
| 367 |
<PieChart>
|
| 368 |
+
<Pie
|
| 369 |
+
data={categoryData}
|
| 370 |
+
cx="50%" cy="50%"
|
| 371 |
+
innerRadius={50} outerRadius={75}
|
| 372 |
+
paddingAngle={3} dataKey="value"
|
| 373 |
+
>
|
| 374 |
{categoryData.map((entry, index) => (
|
| 375 |
<Cell key={index} fill={entry.color} stroke="transparent" />
|
| 376 |
))}
|
|
|
|
| 380 |
active && payload?.length ? (
|
| 381 |
<div className="glass-card p-2 text-xs">
|
| 382 |
<span style={{ color: payload[0].payload.color }}>{payload[0].name}</span>
|
| 383 |
+
<span className="ml-2 font-bold" style={{ color: "var(--fg)" }}>
|
| 384 |
+
${(payload[0].value as number).toLocaleString()}
|
| 385 |
+
</span>
|
| 386 |
</div>
|
| 387 |
) : null
|
| 388 |
}
|
|
|
|
| 398 |
<div key={cat.name} className="flex items-center justify-between">
|
| 399 |
<div className="flex items-center gap-2">
|
| 400 |
<div className="h-2 w-2 rounded-full flex-shrink-0" style={{ background: cat.color }} />
|
| 401 |
+
<span className="text-xs" style={{ color: "var(--fg-muted)" }}>{cat.name}</span>
|
| 402 |
</div>
|
| 403 |
<div className="flex items-center gap-2">
|
| 404 |
+
<div
|
| 405 |
+
className="h-1 w-16 rounded-full overflow-hidden"
|
| 406 |
+
style={{ background: "var(--border)" }}
|
| 407 |
+
>
|
| 408 |
<div
|
| 409 |
className="h-full rounded-full"
|
| 410 |
style={{
|
|
|
|
| 413 |
}}
|
| 414 |
/>
|
| 415 |
</div>
|
| 416 |
+
<span className="text-xs font-medium w-16 text-right" style={{ color: "var(--fg)" }}>
|
| 417 |
${cat.value.toLocaleString()}
|
| 418 |
</span>
|
| 419 |
</div>
|
|
|
|
| 427 |
<motion.div variants={itemVariants} className="glass-card p-6">
|
| 428 |
<div className="flex items-center justify-between mb-5">
|
| 429 |
<div>
|
| 430 |
+
<h2 className="text-base font-semibold" style={{ color: "var(--fg)" }}>{t("recent_transactions")}</h2>
|
| 431 |
+
<p className="text-xs mt-0.5" style={{ color: "var(--fg-muted)" }}>{t("latest_activity")}</p>
|
| 432 |
</div>
|
| 433 |
+
<Link href="/transactions" className="flex items-center gap-1 text-xs text-emerald-500 hover:text-emerald-400 transition-colors">
|
| 434 |
+
{t("view_all")} <ChevronRight className="h-3 w-3" />
|
| 435 |
</Link>
|
| 436 |
</div>
|
| 437 |
<div className="space-y-1">
|
|
|
|
| 443 |
initial={{ opacity: 0, x: -10 }}
|
| 444 |
animate={{ opacity: 1, x: 0 }}
|
| 445 |
transition={{ delay: i * 0.05 }}
|
| 446 |
+
whileHover={{ backgroundColor: isLight ? "rgba(15,23,42,0.03)" : "rgba(255,255,255,0.03)" }}
|
| 447 |
className="flex items-center justify-between rounded-xl px-3 py-3 transition-colors cursor-pointer"
|
| 448 |
>
|
| 449 |
<div className="flex items-center gap-3">
|
| 450 |
+
<div
|
| 451 |
+
className="flex h-9 w-9 items-center justify-center rounded-xl border text-sm font-bold"
|
| 452 |
+
style={{
|
| 453 |
+
background: "var(--card-bg)",
|
| 454 |
+
borderColor: "var(--border-strong)",
|
| 455 |
+
color: "var(--fg-muted)",
|
| 456 |
+
}}
|
| 457 |
+
>
|
| 458 |
{tx.merchant.charAt(0).toUpperCase()}
|
| 459 |
</div>
|
| 460 |
<div>
|
| 461 |
+
<p className="text-sm font-medium" style={{ color: "var(--fg)" }}>{tx.merchant}</p>
|
| 462 |
+
<p className="text-xs" style={{ color: "var(--fg-subtle)" }}>
|
| 463 |
{tx.category} · {tx.timestamp ? new Date(tx.timestamp).toLocaleDateString() : ""}
|
| 464 |
</p>
|
| 465 |
</div>
|
| 466 |
</div>
|
| 467 |
<div className="flex items-center gap-2">
|
| 468 |
+
<span className={`text-sm font-semibold ${tx.amount > 0 ? "text-emerald-500" : ""}`}
|
| 469 |
+
style={tx.amount <= 0 ? { color: "var(--fg)" } : undefined}
|
| 470 |
+
>
|
| 471 |
{tx.amount > 0 ? "+" : ""}${Math.abs(tx.amount).toFixed(2)}
|
| 472 |
</span>
|
| 473 |
{tx.amount > 0 ? (
|
| 474 |
+
<TrendingUp className="h-3.5 w-3.5 text-emerald-500" />
|
| 475 |
) : (
|
| 476 |
+
<TrendingDown className="h-3.5 w-3.5" style={{ color: "var(--fg-subtle)" }} />
|
| 477 |
)}
|
| 478 |
</div>
|
| 479 |
</motion.div>
|
|
|
|
| 484 |
{/* Fraud Shield */}
|
| 485 |
<motion.div
|
| 486 |
variants={itemVariants}
|
| 487 |
+
className={`flex items-center gap-3 rounded-2xl border px-5 py-3 ${
|
| 488 |
+
isLight
|
| 489 |
+
? "border-emerald-300/60 bg-emerald-50"
|
| 490 |
+
: "border-emerald-500/20 bg-emerald-500/5"
|
| 491 |
+
}`}
|
| 492 |
>
|
| 493 |
+
<Shield className="h-4 w-4 text-emerald-500 flex-shrink-0" />
|
| 494 |
+
<p className="text-xs" style={{ color: "var(--fg-muted)" }}>
|
| 495 |
+
<span className="text-emerald-500 font-medium">{t("fraud_shield_active")}</span>
|
| 496 |
{data?.fraud_alert_count
|
| 497 |
+
? ` — ${data.fraud_alert_count} ${t("alerts_require_attention")}`
|
| 498 |
+
: ` — ${t("all_monitored")}`}
|
| 499 |
</p>
|
| 500 |
{data?.fraud_alert_count ? (
|
| 501 |
+
<Link href="/security" className="ml-auto text-xs text-red-500 hover:text-red-400 transition-colors whitespace-nowrap">
|
| 502 |
+
{t("review")} <ChevronRight className="h-3 w-3 inline" />
|
| 503 |
</Link>
|
| 504 |
) : null}
|
| 505 |
</motion.div>
|
| 506 |
</motion.div>
|
| 507 |
);
|
| 508 |
+
}
|
|
@@ -10,6 +10,13 @@ import { Loader2, Sparkles } from "lucide-react";
|
|
| 10 |
|
| 11 |
const PUBLIC_PATHS = ["/login"];
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
function FullPageSpinner() {
|
| 14 |
return (
|
| 15 |
<div className="flex min-h-screen items-center justify-center" style={{ background: "var(--bg, #050505)" }}>
|
|
@@ -29,18 +36,24 @@ export function AppShell({ children }: { children: React.ReactNode }) {
|
|
| 29 |
const router = useRouter();
|
| 30 |
const { isAuthenticated, restoreSession } = useAuthStore();
|
| 31 |
const { theme, setTheme } = useThemeStore();
|
| 32 |
-
const {
|
| 33 |
const [hydrated, setHydrated] = useState(false);
|
| 34 |
|
| 35 |
const isPublic = PUBLIC_PATHS.includes(pathname);
|
| 36 |
|
|
|
|
| 37 |
useEffect(() => {
|
| 38 |
-
// Apply persisted theme to DOM
|
| 39 |
setTheme(theme);
|
| 40 |
-
// Restore session, then optionally sync preferences from backend
|
| 41 |
restoreSession().finally(() => setHydrated(true));
|
| 42 |
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
if (!hydrated) return <FullPageSpinner />;
|
| 45 |
if (isPublic) return <>{children}</>;
|
| 46 |
if (!isAuthenticated) {
|
|
|
|
| 10 |
|
| 11 |
const PUBLIC_PATHS = ["/login"];
|
| 12 |
|
| 13 |
+
// Lang codes mapped to BCP-47 HTML lang values
|
| 14 |
+
const LANG_MAP: Record<string, string> = {
|
| 15 |
+
en: "en",
|
| 16 |
+
hi: "hi",
|
| 17 |
+
mr: "mr",
|
| 18 |
+
};
|
| 19 |
+
|
| 20 |
function FullPageSpinner() {
|
| 21 |
return (
|
| 22 |
<div className="flex min-h-screen items-center justify-center" style={{ background: "var(--bg, #050505)" }}>
|
|
|
|
| 36 |
const router = useRouter();
|
| 37 |
const { isAuthenticated, restoreSession } = useAuthStore();
|
| 38 |
const { theme, setTheme } = useThemeStore();
|
| 39 |
+
const { language } = useLanguageStore();
|
| 40 |
const [hydrated, setHydrated] = useState(false);
|
| 41 |
|
| 42 |
const isPublic = PUBLIC_PATHS.includes(pathname);
|
| 43 |
|
| 44 |
+
// Apply persisted theme on mount
|
| 45 |
useEffect(() => {
|
|
|
|
| 46 |
setTheme(theme);
|
|
|
|
| 47 |
restoreSession().finally(() => setHydrated(true));
|
| 48 |
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
| 49 |
|
| 50 |
+
// Sync <html lang> whenever language changes
|
| 51 |
+
useEffect(() => {
|
| 52 |
+
if (typeof document !== "undefined") {
|
| 53 |
+
document.documentElement.lang = LANG_MAP[language] ?? language;
|
| 54 |
+
}
|
| 55 |
+
}, [language]);
|
| 56 |
+
|
| 57 |
if (!hydrated) return <FullPageSpinner />;
|
| 58 |
if (isPublic) return <>{children}</>;
|
| 59 |
if (!isAuthenticated) {
|
|
@@ -6,6 +6,7 @@ import { usePathname } from "next/navigation";
|
|
| 6 |
import { Sidebar } from "./Sidebar";
|
| 7 |
import { Navbar } from "./Navbar";
|
| 8 |
import { Menu } from "lucide-react";
|
|
|
|
| 9 |
|
| 10 |
// ─── Page transition wrapper ──────────────────────────────────────────────────
|
| 11 |
function PageTransition({ children }: { children: React.ReactNode }) {
|
|
@@ -28,23 +29,39 @@ function PageTransition({ children }: { children: React.ReactNode }) {
|
|
| 28 |
|
| 29 |
export function DashboardLayout({ children }: { children: React.ReactNode }) {
|
| 30 |
const [mobileOpen, setMobileOpen] = useState(false);
|
|
|
|
|
|
|
| 31 |
|
| 32 |
return (
|
| 33 |
-
<div
|
|
|
|
|
|
|
|
|
|
| 34 |
{/* Ambient background gradients */}
|
| 35 |
<div className="fixed inset-0 z-0 overflow-hidden pointer-events-none">
|
| 36 |
-
<div className="absolute top-[-15%] left-[-5%] w-[45%] h-[45%] rounded-full bg-blue-600/10 blur-[140px]" />
|
| 37 |
-
<div className="absolute bottom-[-15%] right-[-5%] w-[45%] h-[45%] rounded-full bg-emerald-600/10 blur-[140px]" />
|
| 38 |
-
<div className="absolute top-[40%] left-[40%] w-[30%] h-[30%] rounded-full bg-purple-600/5 blur-[120px]" />
|
| 39 |
-
{/* Noise texture */}
|
| 40 |
<div
|
| 41 |
-
className="absolute
|
| 42 |
-
style={{
|
| 43 |
-
backgroundImage: `url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E")`,
|
| 44 |
-
backgroundRepeat: "repeat",
|
| 45 |
-
backgroundSize: "128px 128px",
|
| 46 |
-
}}
|
| 47 |
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
</div>
|
| 49 |
|
| 50 |
{/* ── Desktop Sidebar ─────────────────────────────────────────────────── */}
|
|
@@ -61,7 +78,7 @@ export function DashboardLayout({ children }: { children: React.ReactNode }) {
|
|
| 61 |
animate={{ opacity: 1 }}
|
| 62 |
exit={{ opacity: 0 }}
|
| 63 |
onClick={() => setMobileOpen(false)}
|
| 64 |
-
className=
|
| 65 |
/>
|
| 66 |
<motion.div
|
| 67 |
initial={{ x: "-100%" }}
|
|
@@ -79,10 +96,17 @@ export function DashboardLayout({ children }: { children: React.ReactNode }) {
|
|
| 79 |
{/* ── Main content ─────────────────────────────────────────────────────── */}
|
| 80 |
<div className="z-10 flex flex-1 flex-col overflow-hidden min-w-0">
|
| 81 |
{/* Mobile header with hamburger */}
|
| 82 |
-
<div
|
|
|
|
|
|
|
|
|
|
| 83 |
<button
|
| 84 |
onClick={() => setMobileOpen(true)}
|
| 85 |
-
className=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
>
|
| 87 |
<Menu className="h-5 w-5" />
|
| 88 |
</button>
|
|
|
|
| 6 |
import { Sidebar } from "./Sidebar";
|
| 7 |
import { Navbar } from "./Navbar";
|
| 8 |
import { Menu } from "lucide-react";
|
| 9 |
+
import { useThemeStore } from "@/lib/stores/themeStore";
|
| 10 |
|
| 11 |
// ─── Page transition wrapper ──────────────────────────────────────────────────
|
| 12 |
function PageTransition({ children }: { children: React.ReactNode }) {
|
|
|
|
| 29 |
|
| 30 |
export function DashboardLayout({ children }: { children: React.ReactNode }) {
|
| 31 |
const [mobileOpen, setMobileOpen] = useState(false);
|
| 32 |
+
const { theme } = useThemeStore();
|
| 33 |
+
const isLight = theme === "light";
|
| 34 |
|
| 35 |
return (
|
| 36 |
+
<div
|
| 37 |
+
className="flex h-screen overflow-hidden transition-colors duration-300"
|
| 38 |
+
style={{ background: "var(--bg)", color: "var(--fg)" }}
|
| 39 |
+
>
|
| 40 |
{/* Ambient background gradients */}
|
| 41 |
<div className="fixed inset-0 z-0 overflow-hidden pointer-events-none">
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
<div
|
| 43 |
+
className="absolute top-[-15%] left-[-5%] w-[45%] h-[45%] rounded-full blur-[140px] transition-opacity duration-300"
|
| 44 |
+
style={{ background: "var(--ambient-1)" }}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
/>
|
| 46 |
+
<div
|
| 47 |
+
className="absolute bottom-[-15%] right-[-5%] w-[45%] h-[45%] rounded-full blur-[140px] transition-opacity duration-300"
|
| 48 |
+
style={{ background: "var(--ambient-2)" }}
|
| 49 |
+
/>
|
| 50 |
+
<div
|
| 51 |
+
className="absolute top-[40%] left-[40%] w-[30%] h-[30%] rounded-full blur-[120px] transition-opacity duration-300"
|
| 52 |
+
style={{ background: "var(--ambient-3)" }}
|
| 53 |
+
/>
|
| 54 |
+
{/* Noise texture — only visible in dark mode */}
|
| 55 |
+
{!isLight && (
|
| 56 |
+
<div
|
| 57 |
+
className="absolute inset-0 opacity-[0.015]"
|
| 58 |
+
style={{
|
| 59 |
+
backgroundImage: `url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E")`,
|
| 60 |
+
backgroundRepeat: "repeat",
|
| 61 |
+
backgroundSize: "128px 128px",
|
| 62 |
+
}}
|
| 63 |
+
/>
|
| 64 |
+
)}
|
| 65 |
</div>
|
| 66 |
|
| 67 |
{/* ── Desktop Sidebar ─────────────────────────────────────────────────── */}
|
|
|
|
| 78 |
animate={{ opacity: 1 }}
|
| 79 |
exit={{ opacity: 0 }}
|
| 80 |
onClick={() => setMobileOpen(false)}
|
| 81 |
+
className={`fixed inset-0 z-30 backdrop-blur-sm lg:hidden ${isLight ? "bg-slate-900/30" : "bg-black/60"}`}
|
| 82 |
/>
|
| 83 |
<motion.div
|
| 84 |
initial={{ x: "-100%" }}
|
|
|
|
| 96 |
{/* ── Main content ─────────────────────────────────────────────────────── */}
|
| 97 |
<div className="z-10 flex flex-1 flex-col overflow-hidden min-w-0">
|
| 98 |
{/* Mobile header with hamburger */}
|
| 99 |
+
<div
|
| 100 |
+
className="flex items-center lg:hidden border-b backdrop-blur-xl px-4 py-3"
|
| 101 |
+
style={{ background: "var(--navbar-bg)", borderColor: "var(--border)" }}
|
| 102 |
+
>
|
| 103 |
<button
|
| 104 |
onClick={() => setMobileOpen(true)}
|
| 105 |
+
className={`rounded-xl p-2 mr-3 transition-colors ${
|
| 106 |
+
isLight
|
| 107 |
+
? "bg-slate-100 text-slate-500 hover:text-slate-800"
|
| 108 |
+
: "bg-white/5 text-zinc-400 hover:text-white"
|
| 109 |
+
}`}
|
| 110 |
>
|
| 111 |
<Menu className="h-5 w-5" />
|
| 112 |
</button>
|
|
@@ -5,9 +5,12 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
|
| 5 |
import { NotificationBell } from "@/components/notifications/NotificationPanel";
|
| 6 |
import { motion } from "framer-motion";
|
| 7 |
import { useAuthStore } from "@/lib/stores/authStore";
|
|
|
|
| 8 |
|
| 9 |
export function Navbar() {
|
| 10 |
const { user } = useAuthStore();
|
|
|
|
|
|
|
| 11 |
|
| 12 |
const displayName = user?.name || "User";
|
| 13 |
const initials = displayName
|
|
@@ -18,21 +21,32 @@ export function Navbar() {
|
|
| 18 |
.slice(0, 2);
|
| 19 |
|
| 20 |
return (
|
| 21 |
-
<header
|
|
|
|
|
|
|
|
|
|
| 22 |
{/* Search */}
|
| 23 |
<div className="flex flex-1 items-center">
|
| 24 |
<div className="relative w-full max-w-sm">
|
| 25 |
<div className="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3">
|
| 26 |
-
<Search className="h-4 w-4
|
| 27 |
</div>
|
| 28 |
<input
|
| 29 |
id="search"
|
| 30 |
-
className=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
placeholder="Search transactions, ask AI..."
|
| 32 |
type="search"
|
| 33 |
/>
|
| 34 |
<div className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3">
|
| 35 |
-
<kbd
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
⌘K
|
| 37 |
</kbd>
|
| 38 |
</div>
|
|
@@ -45,7 +59,7 @@ export function Navbar() {
|
|
| 45 |
<NotificationBell />
|
| 46 |
|
| 47 |
{/* Divider */}
|
| 48 |
-
<div className="h-6 w-px
|
| 49 |
|
| 50 |
{/* User */}
|
| 51 |
<motion.div
|
|
@@ -53,7 +67,10 @@ export function Navbar() {
|
|
| 53 |
className="flex items-center gap-3 cursor-pointer group"
|
| 54 |
>
|
| 55 |
<div className="flex flex-col text-right">
|
| 56 |
-
<span
|
|
|
|
|
|
|
|
|
|
| 57 |
{displayName}
|
| 58 |
</span>
|
| 59 |
<span className="text-xs text-emerald-500 leading-tight">
|
|
@@ -62,7 +79,11 @@ export function Navbar() {
|
|
| 62 |
</div>
|
| 63 |
<Avatar className="h-9 w-9 border border-emerald-500/30 ring-2 ring-emerald-500/10">
|
| 64 |
<AvatarImage src="" alt={displayName} />
|
| 65 |
-
<AvatarFallback
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
{initials || <User className="h-4 w-4" />}
|
| 67 |
</AvatarFallback>
|
| 68 |
</Avatar>
|
|
|
|
| 5 |
import { NotificationBell } from "@/components/notifications/NotificationPanel";
|
| 6 |
import { motion } from "framer-motion";
|
| 7 |
import { useAuthStore } from "@/lib/stores/authStore";
|
| 8 |
+
import { useThemeStore } from "@/lib/stores/themeStore";
|
| 9 |
|
| 10 |
export function Navbar() {
|
| 11 |
const { user } = useAuthStore();
|
| 12 |
+
const { theme } = useThemeStore();
|
| 13 |
+
const isLight = theme === "light";
|
| 14 |
|
| 15 |
const displayName = user?.name || "User";
|
| 16 |
const initials = displayName
|
|
|
|
| 21 |
.slice(0, 2);
|
| 22 |
|
| 23 |
return (
|
| 24 |
+
<header
|
| 25 |
+
className="sticky top-0 z-40 flex h-16 w-full items-center justify-between backdrop-blur-xl border-b px-8 transition-colors duration-300"
|
| 26 |
+
style={{ background: "var(--navbar-bg)", borderColor: "var(--border)" }}
|
| 27 |
+
>
|
| 28 |
{/* Search */}
|
| 29 |
<div className="flex flex-1 items-center">
|
| 30 |
<div className="relative w-full max-w-sm">
|
| 31 |
<div className="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3">
|
| 32 |
+
<Search className="h-4 w-4" style={{ color: "var(--fg-subtle)" }} aria-hidden="true" />
|
| 33 |
</div>
|
| 34 |
<input
|
| 35 |
id="search"
|
| 36 |
+
className={`block w-full rounded-xl border py-2 pl-9 pr-3 text-sm transition-all duration-200 outline-none focus:ring-1 focus:ring-emerald-500/40 ${
|
| 37 |
+
isLight
|
| 38 |
+
? "bg-white border-slate-200 text-slate-800 placeholder:text-slate-400 focus:bg-white focus:border-emerald-400/50"
|
| 39 |
+
: "bg-white/5 border-white/10 text-white placeholder:text-zinc-500 focus:bg-white/8 border-0"
|
| 40 |
+
}`}
|
| 41 |
placeholder="Search transactions, ask AI..."
|
| 42 |
type="search"
|
| 43 |
/>
|
| 44 |
<div className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3">
|
| 45 |
+
<kbd
|
| 46 |
+
className={`hidden sm:inline-flex h-5 items-center gap-1 rounded border px-1.5 text-[10px] ${
|
| 47 |
+
isLight ? "border-slate-200 bg-slate-100 text-slate-400" : "border-white/10 bg-white/5 text-zinc-500"
|
| 48 |
+
}`}
|
| 49 |
+
>
|
| 50 |
⌘K
|
| 51 |
</kbd>
|
| 52 |
</div>
|
|
|
|
| 59 |
<NotificationBell />
|
| 60 |
|
| 61 |
{/* Divider */}
|
| 62 |
+
<div className="h-6 w-px" style={{ background: "var(--border-strong)" }} />
|
| 63 |
|
| 64 |
{/* User */}
|
| 65 |
<motion.div
|
|
|
|
| 67 |
className="flex items-center gap-3 cursor-pointer group"
|
| 68 |
>
|
| 69 |
<div className="flex flex-col text-right">
|
| 70 |
+
<span
|
| 71 |
+
className="text-sm font-semibold group-hover:text-emerald-500 transition-colors leading-tight"
|
| 72 |
+
style={{ color: "var(--fg)" }}
|
| 73 |
+
>
|
| 74 |
{displayName}
|
| 75 |
</span>
|
| 76 |
<span className="text-xs text-emerald-500 leading-tight">
|
|
|
|
| 79 |
</div>
|
| 80 |
<Avatar className="h-9 w-9 border border-emerald-500/30 ring-2 ring-emerald-500/10">
|
| 81 |
<AvatarImage src="" alt={displayName} />
|
| 82 |
+
<AvatarFallback
|
| 83 |
+
className={`text-xs font-bold ${
|
| 84 |
+
isLight ? "bg-emerald-100 text-emerald-700" : "bg-emerald-900 text-emerald-400"
|
| 85 |
+
}`}
|
| 86 |
+
>
|
| 87 |
{initials || <User className="h-4 w-4" />}
|
| 88 |
</AvatarFallback>
|
| 89 |
</Avatar>
|
|
@@ -23,18 +23,18 @@ export function Sidebar() {
|
|
| 23 |
const [showLang, setShowLang] = useState(false);
|
| 24 |
|
| 25 |
const navigation = [
|
| 26 |
-
{ key: "overview", href: "/",
|
| 27 |
-
{ key: "transactions", href: "/transactions",
|
| 28 |
-
{ key: "payments", href: "/payments",
|
| 29 |
-
{ key: "analytics", href: "/analytics",
|
| 30 |
-
{ key: "simulator", href: "/simulator",
|
| 31 |
-
{ key: "loans", href: "/loans",
|
| 32 |
-
{ key: "goals", href: "/goals",
|
| 33 |
-
{ key: "documents", href: "/documents",
|
| 34 |
-
{ key: "ai_assistant", href: "/chat",
|
| 35 |
-
{ key: "security", href: "/security",
|
| 36 |
-
{ key: "system_status", href: "/status",
|
| 37 |
-
{ key: "settings", href: "/settings",
|
| 38 |
];
|
| 39 |
|
| 40 |
const handleLogout = () => { logout(); router.replace("/login"); };
|
|
@@ -42,109 +42,218 @@ export function Sidebar() {
|
|
| 42 |
const isLight = theme === "light";
|
| 43 |
|
| 44 |
return (
|
| 45 |
-
<div
|
| 46 |
-
"flex h-full w-60 flex-col overflow-y-auto border-r text-sm"
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
: "
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
<div className="flex h-8 w-8 items-center justify-center rounded-xl bg-gradient-to-br from-emerald-400 to-cyan-500 shadow-lg shadow-emerald-500/20">
|
| 54 |
<Sparkles className="h-4 w-4 text-white" />
|
| 55 |
</div>
|
| 56 |
<div>
|
| 57 |
-
<h1 className="text-base font-bold leading-tight">
|
|
|
|
|
|
|
| 58 |
<p className="text-[10px] text-emerald-500 leading-tight">AI Finance</p>
|
| 59 |
</div>
|
| 60 |
</div>
|
| 61 |
|
| 62 |
-
{/* Nav */}
|
| 63 |
<div className="flex flex-1 flex-col justify-between px-3 py-4">
|
| 64 |
<nav className="space-y-0.5">
|
| 65 |
{navigation.map((item) => {
|
| 66 |
const isActive = pathname === item.href;
|
| 67 |
return (
|
| 68 |
-
<Link
|
|
|
|
|
|
|
| 69 |
className={cn(
|
| 70 |
"group relative flex items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",
|
| 71 |
isActive
|
| 72 |
-
?
|
| 73 |
-
: isLight
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
{isActive && (
|
| 76 |
-
<
|
| 77 |
-
className={cn("absolute inset-0 rounded-xl border", isLight ? "bg-emerald-50 border-emerald-200" : "bg-white/10 border-white/10")}
|
| 78 |
-
transition={{ type: "spring", bounce: 0.2, duration: 0.4 }} />
|
| 79 |
)}
|
| 80 |
-
|
| 81 |
-
<item.icon
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
<span className="relative flex-1">{t(item.key)}</span>
|
|
|
|
| 83 |
{item.badge && (
|
| 84 |
-
<span
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
)}
|
| 88 |
</Link>
|
| 89 |
);
|
| 90 |
})}
|
| 91 |
</nav>
|
| 92 |
|
| 93 |
-
{/* Bottom controls */}
|
| 94 |
-
<div
|
| 95 |
-
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
<div className="h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse flex-shrink-0" />
|
| 98 |
<div className="flex-1 min-w-0">
|
| 99 |
-
<p className="text-xs font-medium text-emerald-500 leading-tight">
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
</div>
|
| 102 |
</div>
|
| 103 |
|
| 104 |
{/* Theme toggle */}
|
| 105 |
-
<button
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
{isLight ? t("theme_light") : t("theme_dark")}
|
| 111 |
</button>
|
| 112 |
|
| 113 |
{/* Language switcher */}
|
| 114 |
<div className="relative">
|
| 115 |
-
<button
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
<Globe className="mr-3 h-4 w-4" />
|
| 120 |
<span className="flex-1 text-left">{LANGUAGES[language].native}</span>
|
| 121 |
-
<span className="text-base">{LANGUAGES[language].flag}</span>
|
| 122 |
</button>
|
|
|
|
| 123 |
{showLang && (
|
| 124 |
-
<div
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
{
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
))
|
| 139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
)}
|
| 141 |
</div>
|
| 142 |
|
| 143 |
{/* Sign out */}
|
| 144 |
-
<button
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
<LogOut className="mr-3 h-4 w-4 flex-shrink-0" />
|
| 149 |
{t("sign_out")}
|
| 150 |
</button>
|
|
|
|
| 23 |
const [showLang, setShowLang] = useState(false);
|
| 24 |
|
| 25 |
const navigation = [
|
| 26 |
+
{ key: "overview", href: "/", icon: LayoutDashboard },
|
| 27 |
+
{ key: "transactions", href: "/transactions", icon: ArrowRightLeft },
|
| 28 |
+
{ key: "payments", href: "/payments", icon: CreditCard, badge: "NEW" },
|
| 29 |
+
{ key: "analytics", href: "/analytics", icon: BarChart2 },
|
| 30 |
+
{ key: "simulator", href: "/simulator", icon: Zap },
|
| 31 |
+
{ key: "loans", href: "/loans", icon: Wallet },
|
| 32 |
+
{ key: "goals", href: "/goals", icon: Target },
|
| 33 |
+
{ key: "documents", href: "/documents", icon: FileText, badge: "AI" },
|
| 34 |
+
{ key: "ai_assistant", href: "/chat", icon: MessageSquare, badge: "AI" },
|
| 35 |
+
{ key: "security", href: "/security", icon: Shield },
|
| 36 |
+
{ key: "system_status", href: "/status", icon: Activity },
|
| 37 |
+
{ key: "settings", href: "/settings", icon: Settings },
|
| 38 |
];
|
| 39 |
|
| 40 |
const handleLogout = () => { logout(); router.replace("/login"); };
|
|
|
|
| 42 |
const isLight = theme === "light";
|
| 43 |
|
| 44 |
return (
|
| 45 |
+
<div
|
| 46 |
+
className="flex h-full w-60 flex-col overflow-y-auto border-r text-sm backdrop-blur-2xl transition-colors duration-300"
|
| 47 |
+
style={{
|
| 48 |
+
background: "var(--sidebar-bg)",
|
| 49 |
+
borderColor: "var(--border)",
|
| 50 |
+
color: "var(--fg)",
|
| 51 |
+
}}
|
| 52 |
+
>
|
| 53 |
+
{/* ── Logo ─────────────────────────────────────────────────────────────── */}
|
| 54 |
+
<div
|
| 55 |
+
className="flex h-16 shrink-0 items-center gap-2.5 px-5 border-b"
|
| 56 |
+
style={{ borderColor: "var(--border)" }}
|
| 57 |
+
>
|
| 58 |
<div className="flex h-8 w-8 items-center justify-center rounded-xl bg-gradient-to-br from-emerald-400 to-cyan-500 shadow-lg shadow-emerald-500/20">
|
| 59 |
<Sparkles className="h-4 w-4 text-white" />
|
| 60 |
</div>
|
| 61 |
<div>
|
| 62 |
+
<h1 className="text-base font-bold leading-tight" style={{ color: "var(--fg)" }}>
|
| 63 |
+
BankBot
|
| 64 |
+
</h1>
|
| 65 |
<p className="text-[10px] text-emerald-500 leading-tight">AI Finance</p>
|
| 66 |
</div>
|
| 67 |
</div>
|
| 68 |
|
| 69 |
+
{/* ── Nav ──────────────────────────────────────────────────────────────── */}
|
| 70 |
<div className="flex flex-1 flex-col justify-between px-3 py-4">
|
| 71 |
<nav className="space-y-0.5">
|
| 72 |
{navigation.map((item) => {
|
| 73 |
const isActive = pathname === item.href;
|
| 74 |
return (
|
| 75 |
+
<Link
|
| 76 |
+
key={item.key}
|
| 77 |
+
href={item.href}
|
| 78 |
className={cn(
|
| 79 |
"group relative flex items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",
|
| 80 |
isActive
|
| 81 |
+
? ""
|
| 82 |
+
: isLight
|
| 83 |
+
? "hover:bg-black/5"
|
| 84 |
+
: "hover:bg-white/5"
|
| 85 |
+
)}
|
| 86 |
+
style={{
|
| 87 |
+
color: isActive
|
| 88 |
+
? "var(--fg)"
|
| 89 |
+
: "var(--fg-subtle)",
|
| 90 |
+
}}
|
| 91 |
+
>
|
| 92 |
+
{/* Active background pill */}
|
| 93 |
+
{isActive && (
|
| 94 |
+
<motion.div
|
| 95 |
+
layoutId="activeNav"
|
| 96 |
+
className={cn(
|
| 97 |
+
"absolute inset-0 rounded-xl border",
|
| 98 |
+
isLight
|
| 99 |
+
? "bg-emerald-50 border-emerald-200/80"
|
| 100 |
+
: "bg-white/10 border-white/10"
|
| 101 |
+
)}
|
| 102 |
+
transition={{ type: "spring", bounce: 0.2, duration: 0.4 }}
|
| 103 |
+
/>
|
| 104 |
+
)}
|
| 105 |
+
{/* Active left accent */}
|
| 106 |
{isActive && (
|
| 107 |
+
<div className="absolute left-0 top-1/2 -translate-y-1/2 h-5 w-0.5 rounded-full bg-emerald-500" />
|
|
|
|
|
|
|
| 108 |
)}
|
| 109 |
+
|
| 110 |
+
<item.icon
|
| 111 |
+
className={cn(
|
| 112 |
+
"relative mr-3 h-4 w-4 flex-shrink-0 transition-colors",
|
| 113 |
+
isActive
|
| 114 |
+
? "text-emerald-500"
|
| 115 |
+
: isLight
|
| 116 |
+
? "text-slate-400 group-hover:text-slate-600"
|
| 117 |
+
: "text-zinc-500 group-hover:text-zinc-300"
|
| 118 |
+
)}
|
| 119 |
+
/>
|
| 120 |
<span className="relative flex-1">{t(item.key)}</span>
|
| 121 |
+
|
| 122 |
{item.badge && (
|
| 123 |
+
<span
|
| 124 |
+
className={cn(
|
| 125 |
+
"relative ml-auto rounded-md px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wide border",
|
| 126 |
+
item.badge === "AI"
|
| 127 |
+
? "bg-emerald-500/15 text-emerald-500 border-emerald-500/30"
|
| 128 |
+
: "bg-blue-500/15 text-blue-500 border-blue-500/30"
|
| 129 |
+
)}
|
| 130 |
+
>
|
| 131 |
+
{item.badge}
|
| 132 |
+
</span>
|
| 133 |
)}
|
| 134 |
</Link>
|
| 135 |
);
|
| 136 |
})}
|
| 137 |
</nav>
|
| 138 |
|
| 139 |
+
{/* ── Bottom controls ───────────────────────────────────────────────── */}
|
| 140 |
+
<div
|
| 141 |
+
className="space-y-1 pt-4 border-t"
|
| 142 |
+
style={{ borderColor: "var(--border)" }}
|
| 143 |
+
>
|
| 144 |
+
{/* AI Shield status */}
|
| 145 |
+
<div
|
| 146 |
+
className={cn(
|
| 147 |
+
"flex items-center gap-2.5 rounded-xl px-3 py-2.5 border",
|
| 148 |
+
isLight
|
| 149 |
+
? "bg-emerald-50 border-emerald-200/80"
|
| 150 |
+
: "bg-emerald-500/5 border-emerald-500/10"
|
| 151 |
+
)}
|
| 152 |
+
>
|
| 153 |
<div className="h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse flex-shrink-0" />
|
| 154 |
<div className="flex-1 min-w-0">
|
| 155 |
+
<p className="text-xs font-medium text-emerald-500 leading-tight">
|
| 156 |
+
{t("ai_shield")}
|
| 157 |
+
</p>
|
| 158 |
+
<p
|
| 159 |
+
className="text-[10px] leading-tight truncate"
|
| 160 |
+
style={{ color: "var(--fg-subtle)" }}
|
| 161 |
+
>
|
| 162 |
+
{t("all_normal")}
|
| 163 |
+
</p>
|
| 164 |
</div>
|
| 165 |
</div>
|
| 166 |
|
| 167 |
{/* Theme toggle */}
|
| 168 |
+
<button
|
| 169 |
+
onClick={toggle}
|
| 170 |
+
className={cn(
|
| 171 |
+
"flex w-full items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",
|
| 172 |
+
isLight ? "hover:bg-black/5" : "hover:bg-white/5"
|
| 173 |
+
)}
|
| 174 |
+
style={{ color: "var(--fg-muted)" }}
|
| 175 |
+
>
|
| 176 |
+
{isLight
|
| 177 |
+
? <Sun className="mr-3 h-4 w-4 text-amber-500" />
|
| 178 |
+
: <Moon className="mr-3 h-4 w-4 text-indigo-400" />}
|
| 179 |
{isLight ? t("theme_light") : t("theme_dark")}
|
| 180 |
</button>
|
| 181 |
|
| 182 |
{/* Language switcher */}
|
| 183 |
<div className="relative">
|
| 184 |
+
<button
|
| 185 |
+
onClick={() => setShowLang(!showLang)}
|
| 186 |
+
className={cn(
|
| 187 |
+
"flex w-full items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",
|
| 188 |
+
isLight ? "hover:bg-black/5" : "hover:bg-white/5",
|
| 189 |
+
showLang && (isLight ? "bg-black/5" : "bg-white/5")
|
| 190 |
+
)}
|
| 191 |
+
style={{ color: "var(--fg-muted)" }}
|
| 192 |
+
>
|
| 193 |
<Globe className="mr-3 h-4 w-4" />
|
| 194 |
<span className="flex-1 text-left">{LANGUAGES[language].native}</span>
|
| 195 |
+
<span className="text-base leading-none">{LANGUAGES[language].flag}</span>
|
| 196 |
</button>
|
| 197 |
+
|
| 198 |
{showLang && (
|
| 199 |
+
<motion.div
|
| 200 |
+
initial={{ opacity: 0, y: 4, scale: 0.97 }}
|
| 201 |
+
animate={{ opacity: 1, y: 0, scale: 1 }}
|
| 202 |
+
exit={{ opacity: 0, y: 4, scale: 0.97 }}
|
| 203 |
+
transition={{ duration: 0.15 }}
|
| 204 |
+
className="absolute bottom-full left-0 right-0 mb-1.5 rounded-xl border overflow-hidden shadow-2xl z-50"
|
| 205 |
+
style={{
|
| 206 |
+
background: isLight ? "white" : "#18181b",
|
| 207 |
+
borderColor: "var(--border-strong)",
|
| 208 |
+
boxShadow: isLight
|
| 209 |
+
? "0 8px 32px rgba(15,23,42,0.12)"
|
| 210 |
+
: "0 8px 32px rgba(0,0,0,0.5)",
|
| 211 |
+
}}
|
| 212 |
+
>
|
| 213 |
+
{(Object.entries(LANGUAGES) as [Language, typeof LANGUAGES[Language]][]).map(
|
| 214 |
+
([code, info]) => (
|
| 215 |
+
<button
|
| 216 |
+
key={code}
|
| 217 |
+
onClick={() => { setLanguage(code); setShowLang(false); }}
|
| 218 |
+
className={cn(
|
| 219 |
+
"flex w-full items-center gap-3 px-3 py-2.5 text-sm transition-colors",
|
| 220 |
+
language === code
|
| 221 |
+
? isLight
|
| 222 |
+
? "bg-emerald-50 text-emerald-700"
|
| 223 |
+
: "bg-emerald-500/10 text-emerald-400"
|
| 224 |
+
: isLight
|
| 225 |
+
? "text-slate-600 hover:bg-slate-50"
|
| 226 |
+
: "text-zinc-300 hover:bg-white/5"
|
| 227 |
+
)}
|
| 228 |
+
>
|
| 229 |
+
<span className="text-base leading-none">{info.flag}</span>
|
| 230 |
+
<span className="flex-1 text-left font-medium">{info.native}</span>
|
| 231 |
+
<span
|
| 232 |
+
className="text-xs"
|
| 233 |
+
style={{ color: "var(--fg-subtle)" }}
|
| 234 |
+
>
|
| 235 |
+
{info.label}
|
| 236 |
+
</span>
|
| 237 |
+
{language === code && (
|
| 238 |
+
<span className="ml-1 text-emerald-500 text-xs">✓</span>
|
| 239 |
+
)}
|
| 240 |
+
</button>
|
| 241 |
+
)
|
| 242 |
+
)}
|
| 243 |
+
</motion.div>
|
| 244 |
)}
|
| 245 |
</div>
|
| 246 |
|
| 247 |
{/* Sign out */}
|
| 248 |
+
<button
|
| 249 |
+
onClick={handleLogout}
|
| 250 |
+
className={cn(
|
| 251 |
+
"flex w-full items-center rounded-xl px-3 py-2.5 font-medium transition-all duration-200",
|
| 252 |
+
isLight
|
| 253 |
+
? "text-slate-500 hover:bg-red-50 hover:text-red-600"
|
| 254 |
+
: "text-zinc-500 hover:bg-red-500/10 hover:text-red-400"
|
| 255 |
+
)}
|
| 256 |
+
>
|
| 257 |
<LogOut className="mr-3 h-4 w-4 flex-shrink-0" />
|
| 258 |
{t("sign_out")}
|
| 259 |
</button>
|
|
@@ -7,14 +7,20 @@ import {
|
|
| 7 |
DollarSign, X, CheckCheck, Bell, RefreshCw
|
| 8 |
} from "lucide-react";
|
| 9 |
import { notificationsApi, NotificationItem } from "@/lib/api";
|
|
|
|
| 10 |
|
| 11 |
// ─── Type config ──────────────────────────────────────────────────────────────
|
| 12 |
-
const typeConfig: Record<string, {
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
};
|
| 19 |
|
| 20 |
function getTypeConfig(type: string) {
|
|
@@ -36,13 +42,16 @@ function NotifItem({
|
|
| 36 |
notification,
|
| 37 |
onDismiss,
|
| 38 |
onRead,
|
|
|
|
| 39 |
}: {
|
| 40 |
notification: NotificationItem;
|
| 41 |
onDismiss: (id: string) => void;
|
| 42 |
onRead: (id: string) => void;
|
|
|
|
| 43 |
}) {
|
| 44 |
const config = getTypeConfig(notification.type);
|
| 45 |
const Icon = config.icon;
|
|
|
|
| 46 |
|
| 47 |
return (
|
| 48 |
<motion.div
|
|
@@ -52,24 +61,32 @@ function NotifItem({
|
|
| 52 |
exit={{ opacity: 0, x: 20, height: 0, marginBottom: 0 }}
|
| 53 |
transition={{ duration: 0.25 }}
|
| 54 |
onClick={() => onRead(notification.id)}
|
| 55 |
-
className={`relative flex gap-3 rounded-xl border p-3 cursor-pointer transition-all group ${
|
| 56 |
-
!notification.read ? "ring-1 ring-
|
| 57 |
}`}
|
| 58 |
>
|
| 59 |
{!notification.read && (
|
| 60 |
-
<div className="absolute top-3 right-3 h-1.5 w-1.5 rounded-full bg-blue-
|
| 61 |
)}
|
| 62 |
-
<div className={`flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg border ${
|
| 63 |
<Icon className={`h-4 w-4 ${config.color}`} />
|
| 64 |
</div>
|
| 65 |
<div className="flex-1 min-w-0 pr-4">
|
| 66 |
-
<p className="text-xs font-semibold
|
| 67 |
-
|
| 68 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
</div>
|
| 70 |
<button
|
| 71 |
onClick={(e) => { e.stopPropagation(); onDismiss(notification.id); }}
|
| 72 |
-
className=
|
|
|
|
|
|
|
| 73 |
>
|
| 74 |
<X className="h-3 w-3" />
|
| 75 |
</button>
|
|
@@ -85,6 +102,9 @@ export function NotificationPanel({
|
|
| 85 |
isOpen: boolean;
|
| 86 |
onClose: () => void;
|
| 87 |
}) {
|
|
|
|
|
|
|
|
|
|
| 88 |
const [notifications, setNotifications] = useState<NotificationItem[]>([]);
|
| 89 |
const [unreadCount, setUnreadCount] = useState(0);
|
| 90 |
const [filter, setFilter] = useState<"all" | "unread">("all");
|
|
@@ -142,13 +162,25 @@ export function NotificationPanel({
|
|
| 142 |
animate={{ opacity: 1, y: 0, scale: 1 }}
|
| 143 |
exit={{ opacity: 0, y: -10, scale: 0.97 }}
|
| 144 |
transition={{ duration: 0.2, ease: "easeOut" }}
|
| 145 |
-
className="absolute right-0 top-full mt-2 z-50 w-80 rounded-2xl border
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
>
|
| 147 |
{/* Header */}
|
| 148 |
-
<div
|
|
|
|
|
|
|
|
|
|
| 149 |
<div className="flex items-center gap-2">
|
| 150 |
-
<Bell className="h-4 w-4
|
| 151 |
-
<span className="text-sm font-semibold
|
|
|
|
|
|
|
| 152 |
{unreadCount > 0 && (
|
| 153 |
<span className="flex h-4 w-4 items-center justify-center rounded-full bg-blue-500 text-[10px] font-bold text-white">
|
| 154 |
{unreadCount}
|
|
@@ -156,30 +188,50 @@ export function NotificationPanel({
|
|
| 156 |
)}
|
| 157 |
</div>
|
| 158 |
<div className="flex items-center gap-2">
|
| 159 |
-
<button
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
<RefreshCw className={`h-3.5 w-3.5 ${loading ? "animate-spin" : ""}`} />
|
| 161 |
</button>
|
| 162 |
{unreadCount > 0 && (
|
| 163 |
-
<button
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
<CheckCheck className="h-3 w-3" />
|
| 165 |
All read
|
| 166 |
</button>
|
| 167 |
)}
|
| 168 |
-
<button
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
<X className="h-4 w-4" />
|
| 170 |
</button>
|
| 171 |
</div>
|
| 172 |
</div>
|
| 173 |
|
| 174 |
{/* Filter tabs */}
|
| 175 |
-
<div
|
|
|
|
|
|
|
|
|
|
| 176 |
{(["all", "unread"] as const).map((f) => (
|
| 177 |
<button
|
| 178 |
key={f}
|
| 179 |
onClick={() => setFilter(f)}
|
| 180 |
className={`rounded-lg px-3 py-1 text-xs font-medium capitalize transition-all ${
|
| 181 |
-
filter === f
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
}`}
|
|
|
|
| 183 |
>
|
| 184 |
{f} {f === "unread" && unreadCount > 0 && `(${unreadCount})`}
|
| 185 |
</button>
|
|
@@ -191,7 +243,7 @@ export function NotificationPanel({
|
|
| 191 |
<AnimatePresence mode="popLayout">
|
| 192 |
{loading ? (
|
| 193 |
<div className="flex items-center justify-center py-8">
|
| 194 |
-
<RefreshCw className="h-5 w-5
|
| 195 |
</div>
|
| 196 |
) : displayed.length === 0 ? (
|
| 197 |
<motion.div
|
|
@@ -199,19 +251,30 @@ export function NotificationPanel({
|
|
| 199 |
animate={{ opacity: 1 }}
|
| 200 |
className="flex flex-col items-center gap-2 py-8 text-center"
|
| 201 |
>
|
| 202 |
-
<Bell className="h-8 w-8
|
| 203 |
-
<p className="text-sm
|
| 204 |
</motion.div>
|
| 205 |
) : (
|
| 206 |
displayed.map((n) => (
|
| 207 |
-
<NotifItem
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
))
|
| 209 |
)}
|
| 210 |
</AnimatePresence>
|
| 211 |
</div>
|
| 212 |
|
| 213 |
-
<div
|
| 214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
</div>
|
| 216 |
</motion.div>
|
| 217 |
</>
|
|
@@ -222,6 +285,8 @@ export function NotificationPanel({
|
|
| 222 |
|
| 223 |
// ─── Notification Bell ────────────────────────────────────────────────────────
|
| 224 |
export function NotificationBell() {
|
|
|
|
|
|
|
| 225 |
const [isOpen, setIsOpen] = useState(false);
|
| 226 |
const [unreadCount, setUnreadCount] = useState(0);
|
| 227 |
|
|
@@ -235,7 +300,11 @@ export function NotificationBell() {
|
|
| 235 |
whileHover={{ scale: 1.05 }}
|
| 236 |
whileTap={{ scale: 0.95 }}
|
| 237 |
onClick={() => setIsOpen((v) => !v)}
|
| 238 |
-
className=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
>
|
| 240 |
<Bell className="h-5 w-5" aria-hidden="true" />
|
| 241 |
{unreadCount > 0 && (
|
|
|
|
| 7 |
DollarSign, X, CheckCheck, Bell, RefreshCw
|
| 8 |
} from "lucide-react";
|
| 9 |
import { notificationsApi, NotificationItem } from "@/lib/api";
|
| 10 |
+
import { useThemeStore } from "@/lib/stores/themeStore";
|
| 11 |
|
| 12 |
// ─── Type config ──────────────────────────────────────────────────────────────
|
| 13 |
+
const typeConfig: Record<string, {
|
| 14 |
+
icon: React.ElementType;
|
| 15 |
+
color: string;
|
| 16 |
+
darkBg: string;
|
| 17 |
+
lightBg: string;
|
| 18 |
+
}> = {
|
| 19 |
+
alert: { icon: Shield, color: "text-red-500", darkBg: "bg-red-500/10 border-red-500/20", lightBg: "bg-red-50 border-red-200/70" },
|
| 20 |
+
insight: { icon: Sparkles, color: "text-blue-500", darkBg: "bg-blue-500/10 border-blue-500/20", lightBg: "bg-blue-50 border-blue-200/70" },
|
| 21 |
+
warning: { icon: AlertTriangle, color: "text-amber-500", darkBg: "bg-amber-500/10 border-amber-500/20", lightBg: "bg-amber-50 border-amber-200/70" },
|
| 22 |
+
success: { icon: TrendingUp, color: "text-emerald-500", darkBg: "bg-emerald-500/10 border-emerald-500/20", lightBg: "bg-emerald-50 border-emerald-200/70" },
|
| 23 |
+
default: { icon: DollarSign, color: "text-slate-500", darkBg: "bg-zinc-500/10 border-zinc-500/20", lightBg: "bg-slate-50 border-slate-200/70" },
|
| 24 |
};
|
| 25 |
|
| 26 |
function getTypeConfig(type: string) {
|
|
|
|
| 42 |
notification,
|
| 43 |
onDismiss,
|
| 44 |
onRead,
|
| 45 |
+
isLight,
|
| 46 |
}: {
|
| 47 |
notification: NotificationItem;
|
| 48 |
onDismiss: (id: string) => void;
|
| 49 |
onRead: (id: string) => void;
|
| 50 |
+
isLight: boolean;
|
| 51 |
}) {
|
| 52 |
const config = getTypeConfig(notification.type);
|
| 53 |
const Icon = config.icon;
|
| 54 |
+
const bgClass = isLight ? config.lightBg : config.darkBg;
|
| 55 |
|
| 56 |
return (
|
| 57 |
<motion.div
|
|
|
|
| 61 |
exit={{ opacity: 0, x: 20, height: 0, marginBottom: 0 }}
|
| 62 |
transition={{ duration: 0.25 }}
|
| 63 |
onClick={() => onRead(notification.id)}
|
| 64 |
+
className={`relative flex gap-3 rounded-xl border p-3 cursor-pointer transition-all group ${bgClass} ${
|
| 65 |
+
!notification.read ? "ring-1 ring-inset" : "opacity-60"
|
| 66 |
}`}
|
| 67 |
>
|
| 68 |
{!notification.read && (
|
| 69 |
+
<div className="absolute top-3 right-3 h-1.5 w-1.5 rounded-full bg-blue-500" />
|
| 70 |
)}
|
| 71 |
+
<div className={`flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg border ${bgClass}`}>
|
| 72 |
<Icon className={`h-4 w-4 ${config.color}`} />
|
| 73 |
</div>
|
| 74 |
<div className="flex-1 min-w-0 pr-4">
|
| 75 |
+
<p className="text-xs font-semibold leading-tight" style={{ color: "var(--fg)" }}>
|
| 76 |
+
{notification.title}
|
| 77 |
+
</p>
|
| 78 |
+
<p className="text-xs mt-0.5 leading-relaxed line-clamp-2" style={{ color: "var(--fg-muted)" }}>
|
| 79 |
+
{notification.message}
|
| 80 |
+
</p>
|
| 81 |
+
<p className="text-xs mt-1" style={{ color: "var(--fg-subtle)" }}>
|
| 82 |
+
{timeAgo(notification.created_at)}
|
| 83 |
+
</p>
|
| 84 |
</div>
|
| 85 |
<button
|
| 86 |
onClick={(e) => { e.stopPropagation(); onDismiss(notification.id); }}
|
| 87 |
+
className={`absolute top-2 right-2 p-0.5 rounded transition-colors opacity-0 group-hover:opacity-100 ${
|
| 88 |
+
isLight ? "text-slate-400 hover:text-slate-600" : "text-zinc-600 hover:text-zinc-400"
|
| 89 |
+
}`}
|
| 90 |
>
|
| 91 |
<X className="h-3 w-3" />
|
| 92 |
</button>
|
|
|
|
| 102 |
isOpen: boolean;
|
| 103 |
onClose: () => void;
|
| 104 |
}) {
|
| 105 |
+
const { theme } = useThemeStore();
|
| 106 |
+
const isLight = theme === "light";
|
| 107 |
+
|
| 108 |
const [notifications, setNotifications] = useState<NotificationItem[]>([]);
|
| 109 |
const [unreadCount, setUnreadCount] = useState(0);
|
| 110 |
const [filter, setFilter] = useState<"all" | "unread">("all");
|
|
|
|
| 162 |
animate={{ opacity: 1, y: 0, scale: 1 }}
|
| 163 |
exit={{ opacity: 0, y: -10, scale: 0.97 }}
|
| 164 |
transition={{ duration: 0.2, ease: "easeOut" }}
|
| 165 |
+
className="absolute right-0 top-full mt-2 z-50 w-80 rounded-2xl border backdrop-blur-2xl overflow-hidden"
|
| 166 |
+
style={{
|
| 167 |
+
background: isLight ? "rgba(255,255,255,0.97)" : "rgba(9,9,11,0.97)",
|
| 168 |
+
borderColor: "var(--border-strong)",
|
| 169 |
+
boxShadow: isLight
|
| 170 |
+
? "0 8px 40px rgba(15,23,42,0.14), 0 2px 8px rgba(15,23,42,0.08)"
|
| 171 |
+
: "0 8px 40px rgba(0,0,0,0.6)",
|
| 172 |
+
}}
|
| 173 |
>
|
| 174 |
{/* Header */}
|
| 175 |
+
<div
|
| 176 |
+
className="flex items-center justify-between border-b px-4 py-3"
|
| 177 |
+
style={{ borderColor: "var(--border)" }}
|
| 178 |
+
>
|
| 179 |
<div className="flex items-center gap-2">
|
| 180 |
+
<Bell className="h-4 w-4" style={{ color: "var(--fg-muted)" }} />
|
| 181 |
+
<span className="text-sm font-semibold" style={{ color: "var(--fg)" }}>
|
| 182 |
+
Notifications
|
| 183 |
+
</span>
|
| 184 |
{unreadCount > 0 && (
|
| 185 |
<span className="flex h-4 w-4 items-center justify-center rounded-full bg-blue-500 text-[10px] font-bold text-white">
|
| 186 |
{unreadCount}
|
|
|
|
| 188 |
)}
|
| 189 |
</div>
|
| 190 |
<div className="flex items-center gap-2">
|
| 191 |
+
<button
|
| 192 |
+
onClick={loadNotifications}
|
| 193 |
+
className="transition-colors hover:text-emerald-500"
|
| 194 |
+
style={{ color: "var(--fg-subtle)" }}
|
| 195 |
+
>
|
| 196 |
<RefreshCw className={`h-3.5 w-3.5 ${loading ? "animate-spin" : ""}`} />
|
| 197 |
</button>
|
| 198 |
{unreadCount > 0 && (
|
| 199 |
+
<button
|
| 200 |
+
onClick={markAllRead}
|
| 201 |
+
className="flex items-center gap-1 text-xs transition-colors hover:text-emerald-500"
|
| 202 |
+
style={{ color: "var(--fg-subtle)" }}
|
| 203 |
+
>
|
| 204 |
<CheckCheck className="h-3 w-3" />
|
| 205 |
All read
|
| 206 |
</button>
|
| 207 |
)}
|
| 208 |
+
<button
|
| 209 |
+
onClick={onClose}
|
| 210 |
+
className="transition-colors hover:text-red-500"
|
| 211 |
+
style={{ color: "var(--fg-subtle)" }}
|
| 212 |
+
>
|
| 213 |
<X className="h-4 w-4" />
|
| 214 |
</button>
|
| 215 |
</div>
|
| 216 |
</div>
|
| 217 |
|
| 218 |
{/* Filter tabs */}
|
| 219 |
+
<div
|
| 220 |
+
className="flex gap-1 border-b px-4 py-2"
|
| 221 |
+
style={{ borderColor: "var(--border)" }}
|
| 222 |
+
>
|
| 223 |
{(["all", "unread"] as const).map((f) => (
|
| 224 |
<button
|
| 225 |
key={f}
|
| 226 |
onClick={() => setFilter(f)}
|
| 227 |
className={`rounded-lg px-3 py-1 text-xs font-medium capitalize transition-all ${
|
| 228 |
+
filter === f
|
| 229 |
+
? isLight
|
| 230 |
+
? "bg-slate-100 text-slate-800"
|
| 231 |
+
: "bg-white/10 text-white"
|
| 232 |
+
: ""
|
| 233 |
}`}
|
| 234 |
+
style={filter !== f ? { color: "var(--fg-subtle)" } : undefined}
|
| 235 |
>
|
| 236 |
{f} {f === "unread" && unreadCount > 0 && `(${unreadCount})`}
|
| 237 |
</button>
|
|
|
|
| 243 |
<AnimatePresence mode="popLayout">
|
| 244 |
{loading ? (
|
| 245 |
<div className="flex items-center justify-center py-8">
|
| 246 |
+
<RefreshCw className="h-5 w-5 animate-spin" style={{ color: "var(--fg-subtle)" }} />
|
| 247 |
</div>
|
| 248 |
) : displayed.length === 0 ? (
|
| 249 |
<motion.div
|
|
|
|
| 251 |
animate={{ opacity: 1 }}
|
| 252 |
className="flex flex-col items-center gap-2 py-8 text-center"
|
| 253 |
>
|
| 254 |
+
<Bell className="h-8 w-8" style={{ color: "var(--fg-subtle)" }} />
|
| 255 |
+
<p className="text-sm" style={{ color: "var(--fg-muted)" }}>No notifications</p>
|
| 256 |
</motion.div>
|
| 257 |
) : (
|
| 258 |
displayed.map((n) => (
|
| 259 |
+
<NotifItem
|
| 260 |
+
key={n.id}
|
| 261 |
+
notification={n}
|
| 262 |
+
onDismiss={dismiss}
|
| 263 |
+
onRead={markRead}
|
| 264 |
+
isLight={isLight}
|
| 265 |
+
/>
|
| 266 |
))
|
| 267 |
)}
|
| 268 |
</AnimatePresence>
|
| 269 |
</div>
|
| 270 |
|
| 271 |
+
<div
|
| 272 |
+
className="border-t px-4 py-2.5"
|
| 273 |
+
style={{ borderColor: "var(--border)" }}
|
| 274 |
+
>
|
| 275 |
+
<p className="text-center text-xs" style={{ color: "var(--fg-subtle)" }}>
|
| 276 |
+
Real-time · AI-powered · Encrypted
|
| 277 |
+
</p>
|
| 278 |
</div>
|
| 279 |
</motion.div>
|
| 280 |
</>
|
|
|
|
| 285 |
|
| 286 |
// ─── Notification Bell ────────────────────────────────────────────────────────
|
| 287 |
export function NotificationBell() {
|
| 288 |
+
const { theme } = useThemeStore();
|
| 289 |
+
const isLight = theme === "light";
|
| 290 |
const [isOpen, setIsOpen] = useState(false);
|
| 291 |
const [unreadCount, setUnreadCount] = useState(0);
|
| 292 |
|
|
|
|
| 300 |
whileHover={{ scale: 1.05 }}
|
| 301 |
whileTap={{ scale: 0.95 }}
|
| 302 |
onClick={() => setIsOpen((v) => !v)}
|
| 303 |
+
className={`relative rounded-xl p-2.5 transition-all duration-200 focus:outline-none ${
|
| 304 |
+
isLight
|
| 305 |
+
? "bg-slate-100 text-slate-500 hover:bg-slate-200 hover:text-slate-800"
|
| 306 |
+
: "bg-white/5 text-zinc-400 hover:text-white hover:bg-white/10"
|
| 307 |
+
}`}
|
| 308 |
>
|
| 309 |
<Bell className="h-5 w-5" aria-hidden="true" />
|
| 310 |
{unreadCount > 0 && (
|
|
@@ -15,55 +15,109 @@ export const LANGUAGES: Record<Language, { label: string; native: string; flag:
|
|
| 15 |
// ─── UI translations ──────────────────────────────────────────────────────────
|
| 16 |
export const T: Record<Language, Record<string, string>> = {
|
| 17 |
en: {
|
|
|
|
| 18 |
overview: "Overview", transactions: "Transactions", payments: "Payments",
|
| 19 |
analytics: "Analytics", simulator: "Simulator", loans: "Loans",
|
| 20 |
goals: "Goals", ai_assistant: "AI Assistant", security: "Security",
|
| 21 |
system_status: "System Status", settings: "Settings", documents: "Documents",
|
| 22 |
sign_out: "Sign Out", ai_shield: "AI Shield Active", all_normal: "All systems normal",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
upload_doc: "Upload Document", doc_analyzer: "Document Analyzer",
|
| 24 |
ask_doc: "Ask about this document...", analyzing: "Analyzing...",
|
| 25 |
no_docs: "No documents yet", drop_here: "Drop files here or click to upload",
|
| 26 |
supported: "PDF, DOCX, TXT, CSV — max 10 MB",
|
|
|
|
| 27 |
chat_placeholder: "Ask about your finances...",
|
|
|
|
| 28 |
theme_dark: "Dark Mode", theme_light: "Light Mode",
|
| 29 |
-
language: "Language", save: "Save", cancel: "Cancel",
|
| 30 |
-
fraud_alerts: "Fraud Alerts", total_balance: "Total Balance",
|
| 31 |
-
monthly_income: "Monthly Income", monthly_spend: "Monthly Spend",
|
| 32 |
-
savings_rate: "Savings Rate",
|
| 33 |
},
|
| 34 |
hi: {
|
|
|
|
| 35 |
overview: "अवलोकन", transactions: "लेनदेन", payments: "भुगतान",
|
| 36 |
analytics: "विश्लेषण", simulator: "सिमुलेटर", loans: "ऋण",
|
| 37 |
goals: "लक्ष्य", ai_assistant: "AI सहायक", security: "सुरक्षा",
|
| 38 |
system_status: "सिस्टम स्थिति", settings: "सेटिंग्स", documents: "दस्तावेज़",
|
| 39 |
sign_out: "साइन आउट", ai_shield: "AI शील्ड सक्रिय", all_normal: "सभी सिस्टम सामान्य",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
upload_doc: "दस्तावेज़ अपलोड करें", doc_analyzer: "दस्तावेज़ विश्लेषक",
|
| 41 |
ask_doc: "इस दस्तावेज़ के बारे में पूछें...", analyzing: "विश्लेषण हो रहा है...",
|
| 42 |
no_docs: "अभी तक कोई दस्तावेज़ नहीं", drop_here: "फ़ाइलें यहाँ छोड़ें या अपलोड करने के लिए क्लिक करें",
|
| 43 |
supported: "PDF, DOCX, TXT, CSV — अधिकतम 10 MB",
|
|
|
|
| 44 |
chat_placeholder: "अपने वित्त के बारे में पूछें...",
|
|
|
|
| 45 |
theme_dark: "डार्क मोड", theme_light: "लाइट मोड",
|
| 46 |
-
language: "भाषा", save: "सहेजें", cancel: "रद्द करें",
|
| 47 |
-
fraud_alerts: "धोखाधड़ी अलर्ट", total_balance: "कुल शेष",
|
| 48 |
-
monthly_income: "मासिक आय", monthly_spend: "मासिक खर्च",
|
| 49 |
-
savings_rate: "बचत दर",
|
| 50 |
},
|
| 51 |
mr: {
|
|
|
|
| 52 |
overview: "आढावा", transactions: "व्यवहार", payments: "देयके",
|
| 53 |
analytics: "विश्लेषण", simulator: "सिम्युलेटर", loans: "कर्ज",
|
| 54 |
goals: "उद्दिष्टे", ai_assistant: "AI सहाय्यक", security: "सुरक्षा",
|
| 55 |
system_status: "सिस्टम स्थिती", settings: "सेटिंग्ज", documents: "कागदपत्रे",
|
| 56 |
sign_out: "साइन आउट", ai_shield: "AI शील्ड सक्रिय", all_normal: "सर्व प्रणाली सामान्य",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
upload_doc: "कागदपत्र अपलोड करा", doc_analyzer: "कागदपत्र विश्लेषक",
|
| 58 |
ask_doc: "या कागदपत्राबद्दल विचारा...", analyzing: "विश्लेषण होत आहे...",
|
| 59 |
no_docs: "अद्याप कोणतेही कागदपत्र नाही", drop_here: "फाइल्स येथे टाका किंवा अपलोड करण्यासाठी क्लिक करा",
|
| 60 |
supported: "PDF, DOCX, TXT, CSV — कमाल 10 MB",
|
|
|
|
| 61 |
chat_placeholder: "तुमच्या वित्ताबद्दल विचारा...",
|
|
|
|
| 62 |
theme_dark: "डार्क मोड", theme_light: "लाइट मोड",
|
| 63 |
-
language: "भाषा", save: "जतन करा", cancel: "रद्द करा",
|
| 64 |
-
fraud_alerts: "फसवणूक अलर्ट", total_balance: "एकूण शिल्लक",
|
| 65 |
-
monthly_income: "मासिक उत्पन्न", monthly_spend: "मासिक खर्च",
|
| 66 |
-
savings_rate: "बचत दर",
|
| 67 |
},
|
| 68 |
};
|
| 69 |
|
|
|
|
| 15 |
// ─── UI translations ──────────────────────────────────────────────────────────
|
| 16 |
export const T: Record<Language, Record<string, string>> = {
|
| 17 |
en: {
|
| 18 |
+
// Nav
|
| 19 |
overview: "Overview", transactions: "Transactions", payments: "Payments",
|
| 20 |
analytics: "Analytics", simulator: "Simulator", loans: "Loans",
|
| 21 |
goals: "Goals", ai_assistant: "AI Assistant", security: "Security",
|
| 22 |
system_status: "System Status", settings: "Settings", documents: "Documents",
|
| 23 |
sign_out: "Sign Out", ai_shield: "AI Shield Active", all_normal: "All systems normal",
|
| 24 |
+
// Dashboard
|
| 25 |
+
good_morning: "Good morning", good_afternoon: "Good afternoon", good_evening: "Good evening",
|
| 26 |
+
financial_overview: "Here's your financial overview for today.",
|
| 27 |
+
backend_offline: "Backend offline", showing_cached: "showing cached data.",
|
| 28 |
+
retry: "Retry", ai_daily_briefing: "AI Daily Briefing —",
|
| 29 |
+
health_score: "Health score:", no_fraud_alerts: "No fraud alerts",
|
| 30 |
+
total_balance: "Total Balance", monthly_income: "Monthly Income",
|
| 31 |
+
monthly_spend: "Monthly Spend", savings_rate: "Savings Rate",
|
| 32 |
+
vs_target: "vs target", vs_last_month: "vs last month",
|
| 33 |
+
cash_flow: "Cash Flow", income_vs_expenses: "Income vs Expenses vs Savings",
|
| 34 |
+
income: "Income", expenses: "Expenses", savings: "Savings",
|
| 35 |
+
spending_breakdown: "Spending Breakdown", this_month_by_category: "This month by category",
|
| 36 |
+
recent_transactions: "Recent Transactions", latest_activity: "Your latest activity",
|
| 37 |
+
view_all: "View all", fraud_shield_active: "AI Fraud Shield active",
|
| 38 |
+
alerts_require_attention: "alert(s) require your attention.",
|
| 39 |
+
all_monitored: "All transactions monitored in real-time. No suspicious activity detected.",
|
| 40 |
+
review: "Review",
|
| 41 |
+
// Documents
|
| 42 |
upload_doc: "Upload Document", doc_analyzer: "Document Analyzer",
|
| 43 |
ask_doc: "Ask about this document...", analyzing: "Analyzing...",
|
| 44 |
no_docs: "No documents yet", drop_here: "Drop files here or click to upload",
|
| 45 |
supported: "PDF, DOCX, TXT, CSV — max 10 MB",
|
| 46 |
+
// Chat
|
| 47 |
chat_placeholder: "Ask about your finances...",
|
| 48 |
+
// Settings
|
| 49 |
theme_dark: "Dark Mode", theme_light: "Light Mode",
|
| 50 |
+
language: "Language", save: "Save", cancel: "Cancel", fraud_alerts: "Fraud Alerts",
|
|
|
|
|
|
|
|
|
|
| 51 |
},
|
| 52 |
hi: {
|
| 53 |
+
// Nav
|
| 54 |
overview: "अवलोकन", transactions: "लेनदेन", payments: "भुगतान",
|
| 55 |
analytics: "विश्लेषण", simulator: "सिमुलेटर", loans: "ऋण",
|
| 56 |
goals: "लक्ष्य", ai_assistant: "AI सहायक", security: "सुरक्षा",
|
| 57 |
system_status: "सिस्टम स्थिति", settings: "सेटिंग्स", documents: "दस्तावेज़",
|
| 58 |
sign_out: "साइन आउट", ai_shield: "AI शील्ड सक्रिय", all_normal: "सभी सिस्टम सामान्य",
|
| 59 |
+
// Dashboard
|
| 60 |
+
good_morning: "शुभ प्रभात", good_afternoon: "शुभ दोपहर", good_evening: "शुभ संध्या",
|
| 61 |
+
financial_overview: "यहाँ आज के लिए आपका वित्तीय अवलोकन है।",
|
| 62 |
+
backend_offline: "बैकएंड ऑफ़लाइन", showing_cached: "कैश डेटा दिखा रहा है।",
|
| 63 |
+
retry: "पुनः प्रयास करें", ai_daily_briefing: "AI दैनिक ब्रीफिंग —",
|
| 64 |
+
health_score: "स्वास्थ्य स्कोर:", no_fraud_alerts: "कोई धोखाधड़ी अलर्ट नहीं",
|
| 65 |
+
total_balance: "कुल शेष", monthly_income: "मासिक आय",
|
| 66 |
+
monthly_spend: "मासिक खर्च", savings_rate: "बचत दर",
|
| 67 |
+
vs_target: "लक्ष्य बनाम", vs_last_month: "पिछले महीने बनाम",
|
| 68 |
+
cash_flow: "नकद प्रवाह", income_vs_expenses: "आय बनाम खर्च बनाम बचत",
|
| 69 |
+
income: "आय", expenses: "खर्च", savings: "बचत",
|
| 70 |
+
spending_breakdown: "खर्च विवरण", this_month_by_category: "इस महीने श्रेणी के अनुसार",
|
| 71 |
+
recent_transactions: "हाल के लेनदेन", latest_activity: "आपकी नवीनतम गतिविधि",
|
| 72 |
+
view_all: "सभी देखें", fraud_shield_active: "AI धोखाधड़ी शील्ड सक्रिय",
|
| 73 |
+
alerts_require_attention: "अलर्ट को आपके ध्यान की आवश्यकता है।",
|
| 74 |
+
all_monitored: "सभी लेनदेन वास्तविक समय में मॉनिटर किए जाते हैं। कोई संदिग्ध गतिविधि नहीं मिली।",
|
| 75 |
+
review: "समीक्षा करें",
|
| 76 |
+
// Documents
|
| 77 |
upload_doc: "दस्तावेज़ अपलोड करें", doc_analyzer: "दस्तावेज़ विश्लेषक",
|
| 78 |
ask_doc: "इस दस्तावेज़ के बारे में पूछें...", analyzing: "विश्लेषण हो रहा है...",
|
| 79 |
no_docs: "अभी तक कोई दस्तावेज़ नहीं", drop_here: "फ़ाइलें यहाँ छोड़ें या अपलोड करने के लिए क्लिक करें",
|
| 80 |
supported: "PDF, DOCX, TXT, CSV — अधिकतम 10 MB",
|
| 81 |
+
// Chat
|
| 82 |
chat_placeholder: "अपने वित्त के बारे में पूछें...",
|
| 83 |
+
// Settings
|
| 84 |
theme_dark: "डार्क मोड", theme_light: "लाइट मोड",
|
| 85 |
+
language: "भाषा", save: "सहेजें", cancel: "रद्द करें", fraud_alerts: "धोखाधड़ी अलर्ट",
|
|
|
|
|
|
|
|
|
|
| 86 |
},
|
| 87 |
mr: {
|
| 88 |
+
// Nav
|
| 89 |
overview: "आढावा", transactions: "व्यवहार", payments: "देयके",
|
| 90 |
analytics: "विश्लेषण", simulator: "सिम्युलेटर", loans: "कर्ज",
|
| 91 |
goals: "उद्दिष्टे", ai_assistant: "AI सहाय्यक", security: "सुरक्षा",
|
| 92 |
system_status: "सिस्टम स्थिती", settings: "सेटिंग्ज", documents: "कागदपत्रे",
|
| 93 |
sign_out: "साइन आउट", ai_shield: "AI शील्ड सक्रिय", all_normal: "सर्व प्रणाली सामान्य",
|
| 94 |
+
// Dashboard
|
| 95 |
+
good_morning: "शुभ प्रभात", good_afternoon: "शुभ दुपार", good_evening: "शुभ संध्याकाळ",
|
| 96 |
+
financial_overview: "येथे आजसाठी तुमचा आर्थिक आढावा आहे.",
|
| 97 |
+
backend_offline: "बॅकएंड ऑफलाइन", showing_cached: "कॅश केलेला डेटा दर्शवित आहे.",
|
| 98 |
+
retry: "पुन्हा प्रयत्न करा", ai_daily_briefing: "AI दैनिक ब्रीफिंग —",
|
| 99 |
+
health_score: "आरोग्य स्कोअर:", no_fraud_alerts: "कोणतेही फसवणूक अलर्ट नाहीत",
|
| 100 |
+
total_balance: "एकूण शिल्लक", monthly_income: "मासिक उत्पन्न",
|
| 101 |
+
monthly_spend: "मासिक खर्च", savings_rate: "बचत दर",
|
| 102 |
+
vs_target: "लक्ष्याविरुद्ध", vs_last_month: "गेल्या महिन्याच्या तुलनेत",
|
| 103 |
+
cash_flow: "रोख प्रवाह", income_vs_expenses: "उत्पन्न विरुद्ध खर्च विरुद्ध बचत",
|
| 104 |
+
income: "उत्पन्न", expenses: "खर्च", savings: "बचत",
|
| 105 |
+
spending_breakdown: "खर्च विभागणी", this_month_by_category: "या महिन्यात श्रेणीनुसार",
|
| 106 |
+
recent_transactions: "अलीकडील व्यवहार", latest_activity: "तुमची नवीनतम क्रियाकलाप",
|
| 107 |
+
view_all: "सर्व पहा", fraud_shield_active: "AI फसवणूक शील्ड सक्रिय",
|
| 108 |
+
alerts_require_attention: "अलर्ट्सकडे तुमचे लक्ष वेधणे आवश्यक आहे.",
|
| 109 |
+
all_monitored: "सर्व व्यवहार रिअल-टाइममध्ये मॉनिटर केले जातात. कोणतीही संशयास्पद क्रिया आढळली नाही.",
|
| 110 |
+
review: "पुनरावलोकन करा",
|
| 111 |
+
// Documents
|
| 112 |
upload_doc: "कागदपत्र अपलोड करा", doc_analyzer: "कागदपत्र विश्लेषक",
|
| 113 |
ask_doc: "या कागदपत्राबद्दल विचारा...", analyzing: "विश्लेषण होत आहे...",
|
| 114 |
no_docs: "अद्याप कोणतेही कागदपत्र नाही", drop_here: "फाइल्स येथे टाका किंवा अपलोड करण्यासाठी क्लिक करा",
|
| 115 |
supported: "PDF, DOCX, TXT, CSV — कमाल 10 MB",
|
| 116 |
+
// Chat
|
| 117 |
chat_placeholder: "तुमच्या वित्ताबद्दल विचारा...",
|
| 118 |
+
// Settings
|
| 119 |
theme_dark: "डार्क मोड", theme_light: "लाइट मोड",
|
| 120 |
+
language: "भाषा", save: "जतन करा", cancel: "रद्द करा", fraud_alerts: "फसवणूक अलर्ट",
|
|
|
|
|
|
|
|
|
|
| 121 |
},
|
| 122 |
};
|
| 123 |
|