File size: 1,758 Bytes
bc45e54
 
054d73a
bc45e54
 
054d73a
 
bc45e54
 
 
 
 
 
054d73a
 
 
 
 
bc45e54
054d73a
 
 
e5c2788
054d73a
 
 
 
 
 
bc45e54
 
 
 
 
 
 
 
 
 
 
054d73a
bc45e54
 
 
054d73a
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { clearToken } from "../lib/api";

interface HeaderProps {
  userEmail: string;
  onLogout: () => void;
}

export function Header({ userEmail, onLogout }: HeaderProps) {
  const handleLogout = () => {
    clearToken();
    onLogout();
  };

  return (
    <header className="fixed top-0 left-0 right-0 z-50 backdrop-blur-xl bg-[var(--glass-bg)] border-b border-[var(--glass-border)]">
      <div className="max-w-7xl mx-auto px-6 py-4 flex items-center justify-between">
        <div className="flex items-center gap-3">
          <div className="w-10 h-10 rounded-xl bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-accent)] flex items-center justify-center text-white font-bold text-lg shadow-lg">
            C
          </div>
          <div>
            <h1 className="font-display text-xl font-semibold text-[var(--color-text)]">
              ClassLens
            </h1>
            <p className="text-xs text-[var(--color-text-muted)] hidden sm:block">
              AI-Powered Exam Analysis
            </p>
          </div>
        </div>

        <div className="flex items-center gap-4">
          <div className="flex items-center gap-2 px-4 py-2 rounded-full bg-[var(--color-success)]/10 border border-[var(--color-success)]/20">
            <span className="w-2 h-2 rounded-full bg-[var(--color-success)]"></span>
            <span className="text-sm font-medium text-[var(--color-success)]">
              {userEmail}
            </span>
          </div>
          <button
            onClick={handleLogout}
            className="text-sm text-[var(--color-text-muted)] hover:text-[var(--color-accent)] transition-colors"
          >
            登出
          </button>
        </div>
      </div>
    </header>
  );
}