import{j as e,u as l}from"./vendor-query-Brcc40-Y.js";import{L as i}from"./vendor-react-DP6BW_9B.js";import{T as s,f as c,A as d,i as h}from"./index-tN-ddyeb.js";const x={list:t=>s.get("/notifications",{params:t}).then(n=>n.data),markRead:t=>s.patch(`/notifications/${t}/read`).then(n=>n.data),markAllRead:()=>s.patch("/notifications/read-all").then(t=>t.data)};function u(){const{data:t}=l({queryKey:["notifications","unread-count"],queryFn:()=>x.list({limit:1}),staleTime:3e4}),n=(t==null?void 0:t.unreadCount)??0;return e.jsxs(i,{to:"/notifications",className:"relative flex h-9 w-9 items-center justify-center rounded-xl text-ink-muted hover:bg-bg-elevated hover:text-ink transition-colors","aria-label":`Notifications${n>0?` (${n} unread)`:""}`,children:[e.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),n>0&&e.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-4 w-4 items-center justify-center rounded-full bg-danger text-[10px] font-bold text-white",children:n>9?"9+":n})]})}function j({title:t,subtitle:n,actions:r}){const a=c(o=>o.user);return e.jsxs("header",{className:"flex h-16 items-center justify-between border-b border-bg-overlay bg-bg-surface/90 backdrop-blur-sm px-4 lg:px-6 flex-shrink-0",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-lg font-bold text-ink leading-tight tracking-tight",children:t}),n&&e.jsx("p",{className:"text-xs text-ink-muted",children:n})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r,e.jsx(i,{to:"/search",className:"flex h-9 w-9 items-center justify-center rounded-xl text-ink-muted hover:bg-bg-elevated hover:text-ink transition-colors","aria-label":"Search",children:e.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),e.jsx(u,{}),e.jsx(i,{to:"/profile",className:"hidden lg:block",children:e.jsx(d,{name:(a==null?void 0:a.name)??"U",src:a==null?void 0:a.avatarUrl,size:"sm"})})]})]})}function p({className:t}){return e.jsx("div",{className:h("animate-pulse rounded-lg bg-bg-elevated",t),"aria-hidden":"true"})}export{p as S,j as T,x as n};
