1import{c as d,f as N,u as h,t as i,r as S,j as a}from"./index-R8czvG1X.js";import{d as j}from"./dateUtils-B1EXsZDh.js";import{S as y}from"./SocialLayout-bvjy_v4p.js";import{S as v}from"./SocialSidebars-CC_ZYDx_.js";import{B as b}from"./button-CN9Sy5Px.js";import{C as w,a as k}from"./card-qMEniP19.js";import{L as C}from"./loader-circle-PIG8j-EI.js";import{C as M}from"./circle-user-CrjYVJIG.js";import{B as n}from"./bell-CAp5KcYf.js";import{U as o}from"./users-BFNKezsL.js";import{M as m}from"./message-circle-D66Wluhl.js";import{U}from"./user-plus-DhiCURkr.js";import{H as $}from"./heart-vkxJkAuD.js";import"./chevron-down-DZD7UKVh.js";import"./chevron-up-C9zFlvp9.js";import"./minus-BjFIbbR_.js";import"./x-CQeAdpYC.js";import"./send-CJaccMZT.js";import"./house-CpWvLPR5.js";import"./globe-CcrIAhSW.js";import"./log-out-BYtXtazz.js";import"./newspaper-Dwo9A0rm.js";import"./radio-A7ErJXBk.js";import"./headphones-BtSbxnkH.js";import"./map-pin-D9ShJxqw.js";import"./wifi-D89r5RVV.js";import"./cake-kRIMEfIm.js";/** 2 * @license lucide-react v0.453.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 _=d("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);/** 7 * @license lucide-react v0.453.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const A=d("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);function ia(){const{member:t,isAuthenticated:x}=N(),[,p]=h(),l=i.useUtils();if(!x||!t)return p("/clube-atlantida/login"),null;const{data:s,isLoading:u}=i.community.getNotifications.useQuery({memberId:t.id,limit:50}),r=i.community.markNotificationsRead.useMutation({onSuccess:()=>{l.community.getNotifications.invalidate(),l.community.getUnreadCount.invalidate()}});S.useEffect(()=>{s&&s.some(e=>!e.isRead)&&r.mutate({memberId:t.id})},[s]);const g=e=>{switch(e){case"like":return a.jsx($,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:45",className:"w-5 h-5 text-red-500"});case"comment":return a.jsx(m,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:46",className:"w-5 h-5 text-blue-500"});case"friend_request":return a.jsx(U,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:47",className:"w-5 h-5 text-green-500"});case"friend_accepted":return a.jsx(o,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:48",className:"w-5 h-5 text-green-500"});case"message":return a.jsx(m,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:49",className:"w-5 h-5 text-purple-500"});case"group_invite":return a.jsx(o,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:50",className:"w-5 h-5 text-orange-500"});case"group_post":return a.jsx(o,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:51",className:"w-5 h-5 text-[#1a1a5e]"});case"mention":return a.jsx(_,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:52",className:"w-5 h-5 text-yellow-600"});default:return a.jsx(n,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:53",className:"w-5 h-5 text-gray-400"})}},f=e=>{const c=e.fromMember?.displayName||"Alguém";switch(e.type){case"like":return`${c} gostou da tua publicação`;case"comment":return`${c} comentou na tua publicação`;case"friend_request":return`${c} enviou-te um pedido de amizade`;case"friend_accepted":return`${c} aceitou o teu pedido de amizade`;case"message":return`${c} enviou-te uma mensagem`;case"group_invite":return`${c} convidou-te para um grupo`;case"group_post":return`${c} publicou num grupo teu`;case"mention":return`${c} mencionou-te`;default:return e.content||"Nova notificação"}};return a.jsx(y,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:73",children:a.jsx(v,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:74",children:a.jsxs("div",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:75",className:"max-w-2xl mx-auto",children:[a.jsxs("div",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:76",className:"flex items-center justify-between mb-6",children:[a.jsx("h1",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:77",className:"text-2xl font-bold text-gray-900",children:"Notificações"}),s&&s.length>0&&a.jsxs(b,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:79",variant:"ghost",size:"sm",className:"text-gray-500",onClick:()=>r.mutate({memberId:t.id}),children:[a.jsx(A,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:80",className:"w-4 h-4 mr-1"}),"Marcar todas como lidas"]})]}),u?a.jsx("div",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:87",className:"flex items-center justify-center py-16",children:a.jsx(C,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:88",className:"w-8 h-8 animate-spin text-[#1a1a5e]"})}):s&&s.length>0?a.jsx("div",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:91",className:"space-y-2",children:s.map(e=>a.jsx(w,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:93",className:`transition-colors ${e.isRead?"":"bg-[#1a1a5e]/5 border-[#1a1a5e]/20"}`,children:a.jsx(k,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:94",className:"p-4",children:a.jsxs("div",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:95",className:"flex items-start gap-3",children:[a.jsx("div",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:96",className:"shrink-0 mt-0.5",children:g(e.type)}),a.jsx("div",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:99",className:"flex-1 min-w-0",children:a.jsxs("div",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:100",className:"flex items-start gap-2",children:[e.fromMember?.avatarUrl?a.jsx("img",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:102",src:e.fromMember.avatarUrl,alt:"",className:"w-8 h-8 rounded-full object-cover"}):a.jsx(M,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:104",className:"w-8 h-8 text-gray-300"}),a.jsxs("div",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:106",children:[a.jsx("p",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:107",className:"text-sm text-gray-700",children:f(e)}),a.jsx("p",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:108",className:"text-xs text-gray-400 mt-1",children:j(e.createdAt)})]})]})})]})})},e.id))}):a.jsxs("div",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:120",className:"text-center py-16",children:[a.jsx(n,{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:121",className:"w-16 h-16 mx-auto text-gray-300 mb-4"}),a.jsx("h3",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:122",className:"text-lg font-semibold text-gray-700",children:"Sem notificações"}),a.jsx("p",{"data-loc":"client/src/pages/social/SocialNotificacoes.tsx:123",className:"text-gray-500 mt-1",children:"Quando alguém interagir contigo, verás aqui."})]})]})})})}export{ia 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.