import { jsx, jsxs } from "react/jsx-runtime";
import { Link } from "@tanstack/react-router";
import { Search, Upload, User, Menu } from "lucide-react";
import { P as PRIMARY_NAV, c as categoryName, C as CATEGORIES } from "./router-CEaBCHfX.js";
import { useState } from "react";
import { u as useAuth } from "./use-auth-DoD1gvcu.js";
function SiteHeader() {
  const [open, setOpen] = useState(false);
  const { user, isStaff } = useAuth();
  return /* @__PURE__ */ jsx("header", { className: "bg-surface border-b border-border sticky top-0 z-50", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4", children: [
    /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center h-16 md:h-20", children: [
      /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-8", children: [
        /* @__PURE__ */ jsxs(
          Link,
          {
            to: "/",
            className: "font-serif text-2xl md:text-3xl font-black italic tracking-tighter text-brand",
            children: [
              "MALAWI",
              /* @__PURE__ */ jsx("span", { className: "text-brand-accent", children: "TODAY" })
            ]
          }
        ),
        /* @__PURE__ */ jsxs("nav", { className: "hidden lg:flex gap-5 text-[13px] font-bold uppercase tracking-wide", children: [
          /* @__PURE__ */ jsx(Link, { to: "/", className: "hover:text-brand-accent transition-colors", activeOptions: { exact: true }, activeProps: { className: "text-brand-accent" }, children: "Latest" }),
          PRIMARY_NAV.map((slug) => /* @__PURE__ */ jsx(
            Link,
            {
              to: "/category/$slug",
              params: { slug },
              className: "hover:text-brand-accent transition-colors",
              activeProps: { className: "text-brand-accent" },
              children: categoryName(slug)
            },
            slug
          ))
        ] })
      ] }),
      /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
        /* @__PURE__ */ jsx("button", { className: "p-2 hover:bg-muted rounded-full", "aria-label": "Search", children: /* @__PURE__ */ jsx(Search, { className: "w-5 h-5" }) }),
        /* @__PURE__ */ jsxs(Link, { to: "/submit", className: "hidden md:inline-flex items-center gap-1 text-xs font-bold uppercase tracking-wide px-3 py-2 hover:text-brand-accent", children: [
          /* @__PURE__ */ jsx(Upload, { className: "w-3.5 h-3.5" }),
          " Submit"
        ] }),
        isStaff && /* @__PURE__ */ jsx(Link, { to: "/admin", className: "hidden sm:inline-flex bg-brand text-primary-foreground px-4 py-2 text-xs font-bold rounded-sm hover:bg-brand-accent", children: "NEWSROOM" }),
        !user && /* @__PURE__ */ jsxs(Link, { to: "/auth", className: "hidden sm:inline-flex items-center gap-1 border border-border px-4 py-2 text-xs font-bold rounded-sm hover:bg-muted", children: [
          /* @__PURE__ */ jsx(User, { className: "w-3.5 h-3.5" }),
          " SIGN IN"
        ] }),
        /* @__PURE__ */ jsx(
          "button",
          {
            className: "lg:hidden p-2 hover:bg-muted rounded-full",
            "aria-label": "Menu",
            onClick: () => setOpen((v) => !v),
            children: /* @__PURE__ */ jsx(Menu, { className: "w-5 h-5" })
          }
        )
      ] })
    ] }),
    open && /* @__PURE__ */ jsx("div", { className: "lg:hidden pb-4 grid grid-cols-2 gap-2", children: CATEGORIES.map((c) => /* @__PURE__ */ jsx(
      Link,
      {
        to: "/category/$slug",
        params: { slug: c.slug },
        onClick: () => setOpen(false),
        className: "text-sm font-bold uppercase tracking-wide py-2 px-3 hover:bg-muted rounded-sm",
        children: c.name
      },
      c.slug
    )) })
  ] }) });
}
const news = ["politics", "economy", "crime", "international"];
const life = ["entertainment", "health", "education", "environment"];
function SiteFooter() {
  return /* @__PURE__ */ jsx("footer", { className: "bg-brand text-primary-foreground py-16 mt-16", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4", children: [
    /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-8 mb-12 border-b border-white/10 pb-12", children: [
      /* @__PURE__ */ jsxs("div", { className: "col-span-2", children: [
        /* @__PURE__ */ jsxs("h2", { className: "font-serif text-3xl font-black italic tracking-tighter mb-4", children: [
          "MALAWI",
          /* @__PURE__ */ jsx("span", { className: "text-brand-accent", children: "TODAY" })
        ] }),
        /* @__PURE__ */ jsx("p", { className: "text-white/60 text-sm max-w-xs", children: "The authoritative voice for Malawian news, providing depth, accuracy, and journalistic integrity." })
      ] }),
      /* @__PURE__ */ jsx(FooterCol, { title: "News", slugs: news }),
      /* @__PURE__ */ jsx(FooterCol, { title: "Lifestyle", slugs: life }),
      /* @__PURE__ */ jsxs("div", { children: [
        /* @__PURE__ */ jsx("h5", { className: "font-bold text-xs uppercase tracking-widest text-brand-accent mb-4", children: "Company" }),
        /* @__PURE__ */ jsxs("ul", { className: "space-y-2 text-sm text-white/70", children: [
          /* @__PURE__ */ jsx("li", { children: "About Us" }),
          /* @__PURE__ */ jsx("li", { children: "Contact" }),
          /* @__PURE__ */ jsx("li", { children: "Careers" }),
          /* @__PURE__ */ jsx("li", { children: "Advertise" })
        ] })
      ] }),
      /* @__PURE__ */ jsxs("div", { children: [
        /* @__PURE__ */ jsx("h5", { className: "font-bold text-xs uppercase tracking-widest text-brand-accent mb-4", children: "Network" }),
        /* @__PURE__ */ jsxs("ul", { className: "space-y-2 text-sm text-white/70", children: [
          /* @__PURE__ */ jsx("li", { children: "Job Board" }),
          /* @__PURE__ */ jsx("li", { children: "Directory" }),
          /* @__PURE__ */ jsx("li", { children: "Events" })
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxs("div", { className: "flex flex-col md:flex-row items-center justify-between gap-4 text-[10px] text-white/50 font-bold uppercase tracking-widest", children: [
      /* @__PURE__ */ jsxs("p", { children: [
        "© ",
        (/* @__PURE__ */ new Date()).getFullYear(),
        " Malawi Today Media Group. All rights reserved."
      ] }),
      /* @__PURE__ */ jsxs("div", { className: "flex gap-6", children: [
        /* @__PURE__ */ jsx("span", { children: "Privacy Policy" }),
        /* @__PURE__ */ jsx("span", { children: "Terms of Service" }),
        /* @__PURE__ */ jsx("span", { children: "Cookies" })
      ] })
    ] })
  ] }) });
}
function FooterCol({ title, slugs }) {
  return /* @__PURE__ */ jsxs("div", { children: [
    /* @__PURE__ */ jsx("h5", { className: "font-bold text-xs uppercase tracking-widest text-brand-accent mb-4", children: title }),
    /* @__PURE__ */ jsx("ul", { className: "space-y-2 text-sm text-white/70", children: slugs.map((s) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
      Link,
      {
        to: "/category/$slug",
        params: { slug: s },
        className: "hover:text-white",
        children: categoryName(s)
      }
    ) }, s)) })
  ] });
}
export {
  SiteHeader as S,
  SiteFooter as a
};
