File size: 1,559 Bytes
052672d
 
3ba9c0c
96ac62a
c69ef3e
052672d
bfbf1a7
 
 
 
 
 
38448fc
bfbf1a7
3ba9c0c
60612a5
f80b091
96ac62a
f80b091
 
96ac62a
bfbf1a7
 
 
 
 
 
 
 
96ac62a
 
 
 
 
 
 
f80b091
96ac62a
f80b091
 
38448fc
f80b091
 
 
3ba9c0c
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
import * as React from 'react';
import Link from 'next/link';

import { auth, authEmail } from '@/auth';
import { Button } from '@/components/ui/Button';
import { UserMenu } from '@/components/UserMenu';
import {
  Tooltip,
  TooltipContent,
  TooltipTrigger,
} from '@/components/ui/Tooltip';
import { IconPlus, IconSeparator } from '@/components/ui/Icons';
import { LoginMenu } from './LoginMenu';
import { redirect } from 'next/navigation';

export async function Header() {
  const session = await auth();
  const { isAdmin } = await authEmail();
  return (
    <header className="sticky top-0 z-50 flex items-center justify-end w-full h-16 px-8 border-b shrink-0 bg-gradient-to-b from-background/10 via-background/50 to-background/80 backdrop-blur-xl">
      {/* <Tooltip>
        <TooltipTrigger asChild>
          <Button variant="link" asChild className="mr-2">
            <Link href="/chat">
              <IconPlus />
            </Link>
          </Button>
        </TooltipTrigger>
        <TooltipContent>New chat</TooltipContent>
      </Tooltip> */}
      {isAdmin && (
        <Button variant="link" asChild className="mr-2">
          <Link href="/project">Projects (Internal)</Link>
        </Button>
      )}
      <Button variant="link" asChild className="mr-2">
        <Link href="/chat">Chat</Link>
      </Button>
      <IconSeparator className="size-6 text-muted-foreground/50" />
      <div className="flex items-center">
        {session?.user ? <UserMenu user={session!.user} /> : <LoginMenu />}
      </div>
    </header>
  );
}