PageSourceSearch

https://app.pentrova.ai/assets/Notifications-D3Ood7m2.js

js pentrova.ai collected 2026-10-05 14:00:22 UTC 3,918 bytes, 1 lines download raw bytes

1import{b1 as C,ca as T,r as S,j as e,b9 as p,B as c,cb as L,ba as A,bb as E,R,bc as I,I as B,cc as M,E as $,f as F,X as G,G as N,cd as _,bJ as z,bK as O}from"./index-_c_gQtrU.js";import{T as U,a as K,b as P,c as V}from"./tabs-Cw8gYaU1.js";import{u as Y}from"./usePageTitle-uaPxC3Ql.js";import{F as D}from"./filter-C4kNqFF7.js";import{I as H}from"./inbox-CerOnLjW.js";import"./index-BhLdGwe9.js";import"./index-DJe-iqC9.js";const J=[{key:null,label:"All",icon:H},{key:"scans",label:"Scans",icon:A},{key:"team",label:"Team",icon:E},{key:"billing",label:"Billing",icon:R},{key:"system",label:"System",icon:I}],b="all",n=s=>s??b,X=s=>s===b?null:s;function se(){Y("Notifications");const s=C(),{notifications:t,unreadCount:d,isLoading:o,hasMore:j,error:x,errorMessage:y,category:l,unreadOnly:i,setCategory:u,setUnreadOnly:h,fetchNotifications:m,fetchMore:v,markAllRead:k}=T();S.useEffect(()=>{m(!0)},[m]);const r=l!==null||i,g=[i&&"unread",l].filter(Boolean).join(" "),w=()=>{u(null),h(!1)};return e.jsxs("div",{className:"p-6 lg:p-8 space-y-6 max-w-3xl mx-auto",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-semibold text-foreground flex items-center gap-2",children:[e.jsx(p,{className:"w-6 h-6 text-brand"}),"Notifications"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:d>0?`${d} unread`:"All caught up"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(c,{variant:i?"default":"ghost",size:"sm",onClick:()=>h(!i),className:"text-xs","aria-pressed":i,children:[e.jsx(D,{className:"w-4 h-4 mr-1"}),"Unread only"]}),d>0&&e.jsxs(c,{variant:"ghost",size:"sm",onClick:()=>k(),className:"text-xs",children:[e.jsx(L,{className:"w-4 h-4 mr-1"}),"Mark all read"]})]})]}),e.jsxs(U,{value:n(l),onValueChange:a=>u(X(a)),className:"space-y-6",children:[e.jsx(K,{"aria-label":"Notification categories",className:"w-full justify-start gap-1 overflow-x-auto bg-muted/50",children:J.map(a=>{const f=a.icon;return e.jsxs(P,{value:n(a.key),"data-testid":`notifications-tab-${n(a.key)}`,className:"h-auto flex-shrink-0 gap-1.5 px-3 py-2 text-xs",children:[e.jsx(f,{className:"w-3.5 h-3.5","aria-hidden":"true"}),a.label]},n(a.key))})}),e.jsx(B,{children:x?"":o&&t.length===0?"Loading notifications…":`${t.length} ${t.length===1?"notification":"notifications"}`}),e.jsxs(V,{value:n(l),className:"mt-0 space-y-6",children:[e.jsx("div",{className:"glass-card rounded-xl overflow-hidden",children:o&&t.length===0?e.jsx(M,{count:6,className:"py-1","data-testid":"notifications-loading"}):x&&t.length===0?e.jsx($,{title:"Couldn't load notifications",description:y||"Something went wrong while loading your notifications.",onRetry:()=>{m(!0)},retryLabel:"Retry"}):t.length===0?e.jsx(F,{titleAs:"h2",icon:e.jsx(p,{className:"w-8 h-8 text-muted-foreground/30","aria-hidden":"true"}),"data-testid":r?"notifications-filtered-empty":"notifications-empty",title:r?`No ${g} notifications`:"No notifications",description:r?`No ${g} notifications to show. Nothing failed to load — this filter matches none of yours.`:"You're all caught up! Notifications about scans, team activity, and billing will appear here.",action:r?e.jsxs(c,{onClick:w,className:"gap-2",children:[e.jsx(G,{className:"w-4 h-4"}),"Show all notifications"]}):void 0}):e.jsx(N.div,{className:"divide-y divide-border/50",variants:s(O),initial:"initial",animate:"animate",children:t.map((a,f)=>e.jsx(N.div,{variants:f<12?s(z):void 0,children:e.jsx(_,{notification:a})},a.id))})}),j&&t.length>0&&e.jsx("div",{className:"flex justify-center pt-2",children:e.jsxs(c,{variant:"ghost",size:"sm",onClick:()=>v(),disabled:o,className:"text-xs text-muted-foreground",children:[o?e.jsx("div",{className:"w-4 h-4 border-2 border-muted-foreground border-t-transparent rounded-full animate-spin mr-2"}):null,"Load more"]})})]})]})]})}export{se 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.