1import{z as C,ba as S,r as p,u as v,j as e,aZ as f,an as N,B as h,bR as y,aj as T,bS as _,q as c,bT as A,aB as R,bU as M,bV as j}from"./index-DAO1tbUt.js";import{S as B}from"./SportsBackButton-Bq16Zz3s.js";import{T as K,a as F,b as u}from"./tabs-BOTqs2wV.js";import{S as D,a as P,b as z,c as E,d as o}from"./select-BvYGIjXd.js";import{S as U}from"./SportsShell-CcX7JLYv.js";import{f as V}from"./format-DsDm9H7o.js";import"./index-HpRVQ6qq.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const H=C("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),I={stats_ranking:{labelKey:"notifications.catStatsRanking",dot:"bg-yellow-400",badgeClass:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/40 dark:text-yellow-300"},milestone:{labelKey:"notifications.catMilestone",dot:"bg-purple-500",badgeClass:"bg-purple-100 text-purple-700 dark:bg-purple-900/40 dark:text-purple-300"},personal:{labelKey:"notifications.catPersonal",dot:"bg-green-500",badgeClass:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300"},activity:{labelKey:"notifications.catActivity",dot:"bg-[var(--arena-volt)]",badgeClass:"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300"},management:{labelKey:"notifications.catManagement",dot:"bg-orange-500",badgeClass:"bg-orange-100 text-orange-700 dark:bg-orange-900/40 dark:text-orange-300"}};function L({notif:t,onRead:l,onDelete:d}){const n=I[t.category]??{labelKey:t.category,dot:"bg-gray-400",badgeClass:"bg-muted text-muted-foreground"},x=T(),{t:s}=v(),{title:m,body:i}=_(t,s),g=()=>{t.is_read||l(t.id);const a=M(t);a&&x(a)};return e.jsxs("div",{className:c("group flex items-start gap-4 p-4 rounded-xl border transition-all cursor-pointer",t.is_read?"bg-card border-border hover:border-muted-foreground/30":"bg-[color-mix(in_srgb,var(--arena-volt)_10%,transparent)] border-[color-mix(in_srgb,var(--arena-volt)_25%,transparent)] hover:border-blue-300 dark:bg-blue-950/30 dark:border-blue-900/50 dark:hover:border-blue-800"),onClick:g,children:[e.jsx("div",{className:"mt-1.5 shrink-0",children:e.jsx("span",{className:c("block h-2.5 w-2.5 rounded-full",n.dot)})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[e.jsx("span",{className:c("text-sm font-semibold",t.is_read?"text-foreground/80":"text-foreground"),children:m}),e.jsx(N,{variant:"outline",className:c("text-[10px] px-1.5 py-0 border-0",n.badgeClass),children:s(n.labelKey)})]}),i&&e.jsx("p",{className:"text-sm text-muted-foreground mb-1.5",children:i}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[V(new Date(t.created_at),"d MMM yyyy · HH:mm",{locale:j})," · ",A(new Date(t.created_at),{addSuffix:!0,locale:j})]})]}),e.jsxs("div",{className:"shrink-0 flex items-center gap-1",children:[!t.is_read&&e.jsx(h,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 text-blue-500 hover:bg-blue-100 dark:hover:bg-blue-900/40",title:s("notifications.markAsRead"),onClick:a=>{a.stopPropagation(),l(t.id)},children:e.jsx(y,{className:"h-4 w-4"})}),e.jsx(h,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-950/40",title:s("notifications.delete"),onClick:a=>{a.stopPropagation(),d(t.id)},children:e.jsx(R,{className:"h-4 w-4"})})]})]})}function W(){const{notifications:t,unreadCount:l,markAsRead:d,markAllAsRead:n,deleteNotification:x}=S(),[s,m]=p.useState("all"),[i,g]=p.useState("all"),{t:a}=v(),b=t.filter(r=>{const k=s==="all"||s==="unread"&&!r.is_read||s==="read"&&r.is_read,w=i==="all"||r.category===i;return k&&w});return e.jsx(U,{children:e.jsx("div",{className:"min-h-screen",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx(B,{fallbackTo:"/dashboard",label:a("common.back")}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{className:"h-5 w-5 text-[var(--arena-volt)]"}),e.jsx("h1",{className:"text-xl font-bold text-foreground",children:a("notifications.pageTitle")}),l>0&&e.jsx(N,{className:"bg-red-500 text-white text-xs h-5 px-1.5",children:l})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:a("notifications.pageDesc",{count:t.length})})]}),l>0&&e.jsxs(h,{variant:"outline",size:"sm",className:"gap-1.5 text-xs",onClick:n,children:[e.jsx(y,{className:"h-3.5 w-3.5"}),a("notifications.markAll")]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-5",children:[e.jsx(K,{value:s,onValueChange:r=>m(r),children:e.jsxs(F,{className:"h-8",children:[e.jsx(u,{value:"all",className:"text-xs px-3 h-7",children:a("notifications.filterAll")}),e.jsxs(u,{value:"unread",className:"text-xs px-3 h-7",children:[a("notifications.filterUnread"),l>0&&e.jsx("span",{className:"ml-1.5 bg-red-500 text-white rounded-full px-1.5 py-0 text-[10px]",children:l})]}),e.jsx(u,{value:"read",className:"text-xs px-3 h-7",children:a("notifications.filterRead")})]})}),e.jsxs(D,{value:i,onValueChange:r=>g(r),children:[e.jsxs(P,{className:"h-8 text-xs w-auto min-w-[130px] gap-1",children:[e.jsx(H,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx(z,{placeholder:a("notifications.filterCategory")})]}),e.jsxs(E,{children:[e.jsx(o,{value:"all",children:a("notifications.filterAllCategories")}),e.jsx(o,{value:"stats_ranking",children:a("notifications.catStatsRanking")}),e.jsx(o,{value:"milestone",children:a("notifications.catMilestone")}),e.jsx(o,{value:"personal",children:a("notifications.catPersonal")}),e.jsx(o,{value:"activity",children:a("notifications.catActivity")}),e.jsx(o,{value:"management",children:a("notifications.catManagement")})]})]})]}),b.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx(f,{className:"h-12 w-12 text-muted-foreground
6/30 mb-3"}),e.jsx("p",{className:"text-muted-foreground font-medium",children:a(s==="unread"?"notifications.emptyUnread":"notifications.emptyAll")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a("notifications.noNotificationsHint")})]}):e.jsx("div",{className:"flex flex-col gap-2",children:b.map(r=>e.jsx(L,{notif:r,onRead:d,onDelete:x},r.id))})]})})})}export{W as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.