"use client"; import React, { useState } from "react"; import Image from "next/image"; import { ActiveTab } from "../lib/types"; import { MessageSquare, FolderGit2, UserCheck, PhoneCall, Moon, Sun, Menu, X } from "lucide-react"; const GithubIcon = () => ( ); const LinkedinIcon = () => ( ); const XIcon = () => ( ); const UdemyIcon = () => ( ); const GlobeIcon = () => ( ); interface HeaderProps { activeTab: ActiveTab; setActiveTab: (tab: ActiveTab) => void; openHandoffModal: () => void; theme: "dark" | "light"; toggleTheme: () => void; tutorConfig?: any; } export const Header: React.FC = ({ activeTab, setActiveTab, openHandoffModal, theme, toggleTheme, tutorConfig, }) => { const [mobileMenuOpen, setMobileMenuOpen] = useState(false); const tutorName = tutorConfig?.frontend_ui_dictionary?.header?.profile_name || tutorConfig?.name || "Arun Yadav"; const tutorRole = tutorConfig?.frontend_ui_dictionary?.header?.profile_badge || tutorConfig?.role || "AI Assistant"; const tutorAvatar = tutorConfig?.client_metadata?.avatar_url || tutorConfig?.avatar || "/profile_photo.png"; const projectsTabLabel = tutorConfig?.frontend_ui_dictionary?.header?.nav_tabs?.projects?.label || tutorConfig?.projects_tab_label || "Projects"; const aboutTabLabel = tutorConfig?.frontend_ui_dictionary?.header?.nav_tabs?.about?.label || tutorConfig?.about_tab_label || "About"; const ctaButtonText = tutorConfig?.frontend_ui_dictionary?.header?.cta_button?.text || tutorConfig?.cta_text || "Contact"; const headerSocials = tutorConfig?.frontend_ui_dictionary?.header?.social_links || tutorConfig?.socials; return ( {/* Left Profile Identity */} {tutorName} {tutorRole} {/* Desktop Central Navigation Tabs */} setActiveTab("chat")} className={`flex items-center gap-2 rounded-lg px-4 py-1.5 text-xs font-bold transition-all ${ activeTab === "chat" ? "bg-[var(--accent-green)] text-white shadow-xs" : "text-[var(--text-muted)] hover:text-[var(--text-main)] hover:bg-[var(--bg-surface-hover)]" }`} > AI Assistant setActiveTab("projects")} className={`flex items-center gap-2 rounded-lg px-4 py-1.5 text-xs font-bold transition-all ${ activeTab === "projects" ? "bg-[var(--accent-green)] text-white shadow-xs" : "text-[var(--text-muted)] hover:text-[var(--text-main)] hover:bg-[var(--bg-surface-hover)]" }`} > {projectsTabLabel} setActiveTab("manifesto")} className={`flex items-center gap-2 rounded-lg px-4 py-1.5 text-xs font-bold transition-all ${ activeTab === "manifesto" ? "bg-[var(--accent-green)] text-white shadow-xs" : "text-[var(--text-muted)] hover:text-[var(--text-main)] hover:bg-[var(--bg-surface-hover)]" }`} > {aboutTabLabel} {/* Right Social Links, Theme Toggle & Contact Button */} {headerSocials ? ( headerSocials.map((s: any, idx: number) => { const key = (s.icon_key || s.icon || s.id || "").toLowerCase(); return ( {key === "github" ? ( ) : key === "linkedin" ? ( ) : key === "x" || key === "twitter" ? ( ) : key === "udemy" ? ( ) : key === "website" || key === "globe" ? ( ) : ( {s.symbol_emoji || "🔗"} )} ); }) ) : ( <> > )} {theme === "dark" ? : } {ctaButtonText} {/* Mobile Menu Button */} {theme === "dark" ? : } setMobileMenuOpen(!mobileMenuOpen)} className="rounded-lg border border-[var(--border-subtle)] bg-[var(--bg-surface)] p-2 text-[var(--text-main)]" > {mobileMenuOpen ? : } {/* Mobile Drawer Menu */} {mobileMenuOpen && ( { setActiveTab("chat"); setMobileMenuOpen(false); }} className={`flex items-center gap-2 rounded-lg px-3 py-2 text-xs font-bold ${ activeTab === "chat" ? "bg-[var(--accent-green)] text-white" : "text-[var(--text-muted)]" }`} > AI Assistant { setActiveTab("projects"); setMobileMenuOpen(false); }} className={`flex items-center gap-2 rounded-lg px-3 py-2 text-xs font-bold ${ activeTab === "projects" ? "bg-[var(--accent-green)] text-white" : "text-[var(--text-muted)]" }`} > Projects { setActiveTab("manifesto"); setMobileMenuOpen(false); }} className={`flex items-center gap-2 rounded-lg px-3 py-2 text-xs font-bold ${ activeTab === "manifesto" ? "bg-[var(--accent-green)] text-white" : "text-[var(--text-muted)]" }`} > About { openHandoffModal(); setMobileMenuOpen(false); }} className="flex items-center justify-center gap-2 rounded-lg bg-[var(--accent-green)] py-2 text-xs font-bold text-white mt-2" > Contact Arun )} ); };