1import{r as n,j as e,L as d}from"./index-Bratghjx.js";import{u as i,B as l}from"./messages-CQS4qn8Q.js";import{L as o}from"./loader-circle-BlACLt8x.js";function c(t){if(!t)return"";const a=new Date(t);return Number.isNaN(a.getTime())?"":a.toLocaleDateString("sv-SE",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}function f(){const{messages:t,loading:a,markAllRead:r}=i();return n.useEffect(()=>{!a&&t.some(s=>!s.read)&&r()},[a,t,r]),e.jsxs("div",{children:[e.jsxs("h1",{className:"flex items-center gap-2 text-xl font-black uppercase tracking-wide text-foreground",children:[e.jsx(l,{className:"h-5 w-5 text-primary"})," Meddelanden"]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Här kommer info frÃ¥n din lagledare."}),a?e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(o,{className:"h-6 w-6 animate-spin text-primary"})}):t.length===0?e.jsxs("div",{className:"mt-6 rounded-3xl bg-card p-6 text-center shadow-[var(--shadow-soft)]",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Inga meddelanden just nu ð"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"När lagledaren skickar nÃ¥got hamnar det här."}),e.jsx(d,{to:"/dashboard",className:"mt-4 inline-block text-sm font-bold text-primary",children:"â Till startsidan"})]}):e.jsx("ul",{className:"mt-5 space-y-3",children:t.map(s=>e.jsxs("li",{className:"rounded-3xl bg-card p-4 shadow-[var(--shadow-soft)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h2",{className:"text-base font-black text-foreground",children:s.subject}),s.read?null:e.jsx("span",{className:"mt-1 h-2.5 w-2.5 shrink-0 rounded-full bg-destructive","aria-label":"Oläst"})]}),e.jsx("p",{className:"mt-1 whitespace-pre-line text-sm text-foreground/90",children:s.body}),e.jsx("p",{className:"mt-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:[s.sender,c(s.createdAt)].filter(Boolean).join(" · ")})]},s.id))})]})}export{f as component};
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.