import Button from '@/components/ui/Button'
import { webuiPrefix } from '@/lib/constants'
import AppSettings from '@/components/AppSettings'
import StatusIndicator from '@/components/status/StatusIndicator'
import { TabsList, TabsTrigger } from '@/components/ui/Tabs'
import { useSettingsStore } from '@/stores/settings'
import { useAuthStore } from '@/stores/state'
import { cn } from '@/lib/utils'
import { useTranslation } from 'react-i18next'
import { navigationService } from '@/services/navigation'
import { ZapIcon, LogOutIcon, BrainIcon } from 'lucide-react'
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/Tooltip'
interface NavigationTabProps {
value: string
currentTab: string
children: React.ReactNode
}
function NavigationTab({ value, currentTab, children }: NavigationTabProps) {
return (
{children}
)
}
function shouldShowTableExplorer(storageConfig: any) {
// Always show for now - TODO: fix storageConfig state propagation from health check
return true
// Original logic:
// if (import.meta.env.DEV) return true
// return (
// storageConfig &&
// storageConfig.kv_storage === 'PGKVStorage' &&
// storageConfig.doc_status_storage === 'PGDocStatusStorage' &&
// storageConfig.graph_storage === 'PGGraphStorage' &&
// storageConfig.vector_storage === 'PGVectorStorage'
// )
}
function TabsNavigation() {
const currentTab = useSettingsStore.use.currentTab()
const storageConfig = useSettingsStore.use.storageConfig()
const { t } = useTranslation()
return (
{t('header.documents')}
{t('header.knowledgeGraph')}
{t('header.retrieval')}
{t('header.api')}
{shouldShowTableExplorer(storageConfig) && (
{t('header.tables')}
)}
)
}
export default function SiteHeader() {
const { t } = useTranslation()
const { isGuestMode, username, webuiTitle, webuiDescription } = useAuthStore()
const enableHealthCheck = useSettingsStore.use.enableHealthCheck()
const storageConfig = useSettingsStore.use.storageConfig()
const handleLogout = () => {
navigationService.navigateToLogin();
}
return (
)
}