import { useEffect, useTransition } from 'react' import { Pathway_Gothic_One } from 'next/font/google' import { PiPopcornBold } from "react-icons/pi" const pathway = Pathway_Gothic_One({ weight: "400", style: "normal", subsets: ["latin"], display: "swap" }) import { useStore } from "@/app/state/useStore" import { cn } from "@/lib/utils" import { getTags } from '@/app/server/actions/ai-tube-hf/getTags' import Link from 'next/link' export function TopHeader() { const [_pending, startTransition] = useTransition() const view = useStore(s => s.view) const setView = useStore(s => s.setView) const displayMode = useStore(s => s.displayMode) const setDisplayMode = useStore(s => s.setDisplayMode) const headerMode = useStore(s => s.headerMode) const setHeaderMode = useStore(s => s.setHeaderMode) const setMenuMode = useStore(s => s.setMenuMode) const currentTag = useStore(s => s.currentTag) const setCurrentTag = useStore(s => s.setCurrentTag) const currentTags = useStore(s => s.currentTags) const setCurrentTags = useStore(s => s.setCurrentTags) const isNormalSize = headerMode === "normal" useEffect(() => { if (view === "public_video_embed") { setHeaderMode("hidden") } else if (view === "public_video" || view === "public_channel" || view === "public_music_videos") { setHeaderMode("compact") setMenuMode("slider_hidden") } else { setHeaderMode("normal") setMenuMode("normal_icon") } }, [view]) useEffect(() => { startTransition(async () => { const tags = await getTags() setCurrentTags(tags) }) }, []) if (headerMode === "hidden") { return null } return (
{ setView(view === "public_music_videos" ? "public_music_videos" : "home") }} */ >
{view === "public_music_videos" ? "AiTube Music" : "AiTube"}
Note: AI Tube is still in beta (and this text will be replaced by a search box)
  {/* more buttons? unused for now */}
{ isNormalSize && view !== "public_music_videos" ?
{currentTags.slice(0, 9).map(tag => (
{ setCurrentTag(currentTag === tag ? undefined : tag) }} > {tag}
))}
: null}
) }