File size: 3,480 Bytes
6a059d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { Button } from "@/components/ui/button"
import { Badge } from "@/components/ui/badge"
import { History, Search, Sparkles, Share2, Home } from "lucide-react"
import Link from "next/link"
import type { LucideIcon } from "lucide-react"

interface ChatHeaderProps {
  isResearchMode: boolean
  useHybrid: boolean
  currentSessionId: string | null
  showHistory: boolean
  isLoading: boolean
  onToggleHistory: () => void
  onToggleSidebar?: () => void
  onShare: () => void
  HistoryIcon?: LucideIcon
}

export function ChatHeader({

  isResearchMode,

  useHybrid,

  currentSessionId,

  showHistory,

  onToggleHistory,

  onToggleSidebar,

  onShare,

  HistoryIcon

}: ChatHeaderProps) {
  return (
    <div className="border-b border-white/5 bg-background/60 backdrop-blur-xl flex-shrink-0 relative z-30">

      <div className="flex flex-col gap-1 p-2 md:p-2.5">

        <div className="flex items-center justify-between gap-2">

          <div className="flex items-center gap-1.5 md:gap-2 min-w-0 flex-1">

            <div className="min-w-0 flex-1">

              <p className="text-[9px] md:text-[10px] uppercase tracking-[0.15em] text-muted-foreground truncate">AmaniQuery</p>

              <h1 className="text-xs md:text-sm font-semibold truncate">Conversational Legal Intelligence</h1>

            </div>

            {isResearchMode && (

              <Badge variant="default" className="bg-blue-600/90 text-[9px] md:text-[10px] py-0.5 px-1.5 flex-shrink-0">

                <Search className="w-2.5 h-2.5 mr-0.5" />

                <span className="hidden sm:inline">Research</span>

              </Badge>

            )}

            {useHybrid && !isResearchMode && (

              <Badge variant="default" className="bg-purple-600/90 text-[9px] md:text-[10px] py-0.5 px-1.5 flex-shrink-0">

                <Sparkles className="w-2.5 h-2.5 mr-0.5" />

                <span className="hidden sm:inline">Hybrid</span>

              </Badge>

            )}

          </div>

          <div className="flex items-center gap-1 flex-shrink-0">

            <Button

              variant={showHistory ? "default" : "outline"}

              size="sm"

              className="h-8 md:h-7 rounded-full px-2 md:px-2 text-[11px] flex-shrink-0"

              onClick={() => {

                if (onToggleSidebar && window.innerWidth < 768) {

                  onToggleSidebar()

                } else {

                  onToggleHistory()

                }

              }}

            >

              {HistoryIcon ? <HistoryIcon className="w-3 h-3 md:mr-1" /> : <History className="w-3 h-3 md:mr-1" />}

              <span className="hidden md:inline">History</span>

            </Button>

            {currentSessionId && (

              <Button variant="outline" size="sm" className="h-8 md:h-7 rounded-full px-2 md:px-2 text-[11px] flex-shrink-0" onClick={onShare}>

                <Share2 className="w-3 h-3 md:mr-1" />

                <span className="hidden md:inline">Share</span>

              </Button>

            )}

            <Link href="/">

              <Button variant="outline" size="sm" className="h-8 md:h-7 rounded-full px-2 md:px-2 text-[11px] flex-shrink-0">

                <Home className="w-3 h-3 md:mr-1" />

                <span className="hidden md:inline">Home</span>

              </Button>

            </Link>

          </div>

        </div>

      </div>

    </div>
  )
}