import{c as s,a as r,u as f,Z as x,w as l,b as t,o as a,f as u,i as _,g as c,F as b,e as y,n as p,t as i,N as h}from"./app-z_grtNg1.js";import{_ as v}from"./MobileAppLayout-BU3NJWTn.js";import{_ as g}from"./AppCard-C2KBW1s0.js";import"./ToastStack-xenoaUxd.js";import"./AppModal-DLkXyhIS.js";const N={class:"space-y-3"},k={key:0,class:"rounded-2xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-800"},w={class:"mt-2"},C={class:"flex items-start justify-between gap-3"},B={class:"text-sm font-semibold text-slate-900"},V={class:"mt-1 text-[11px] text-slate-500"},E={class:"mt-2 whitespace-pre-line text-sm text-slate-700"},S={key:0,class:"mt-3 flex justify-end"},$=["onClick"],j={key:1,class:"rounded-2xl border border-dashed border-slate-300 p-4 text-sm text-slate-500"},z={__name:"Index",props:{notifications:{type:Array,default:()=>[]},inboxEnabled:{type:Boolean,default:!0}},setup(n){const m=d=>{h.post(route("app.notifications.read",d),{},{preserveScroll:!0,preserveState:!0})};return(d,o)=>(a(),s(b,null,[r(f(x),{title:"Notifications"}),r(v,{title:"Notifications",subtitle:"Messages from admin"},{default:l(()=>[r(g,{title:"Inbox",subtitle:"Thread-style updates from admin panel."},{default:l(()=>[t("div",N,[n.inboxEnabled?c("",!0):(a(),s("div",k,[o[1]||(o[1]=u(" Notification inbox is turned off in your profile preferences. ",-1)),t("div",w,[r(f(_),{href:d.route("profile.edit",{tab:"notifications"}),class:"font-semibold underline underline-offset-4"},{default:l(()=>[...o[0]||(o[0]=[u(" Open profile preferences ",-1)])]),_:1},8,["href"])])])),(a(!0),s(b,null,y(n.notifications,e=>(a(),s("div",{key:e.id,class:p(["rounded-2xl border p-3",e.read_at?"border-slate-200 bg-white":"border-amber-200 bg-amber-50/60"])},[t("div",C,[t("div",null,[t("div",B,i(e.title),1),t("div",V,i(e.created_at),1)]),t("span",{class:p(["inline-flex rounded-full px-2 py-1 text-[10px] font-semibold",e.read_at?"bg-slate-100 text-slate-600":"bg-amber-100 text-amber-700"])},i(e.read_at?"Read":"New"),3)]),t("div",E,i(e.message),1),e.read_at?c("",!0):(a(),s("div",S,[t("button",{type:"button",class:"rounded-md border border-slate-300 bg-white px-3 py-1.5 text-xs font-semibold text-slate-700",onClick:A=>m(e.id)}," Mark as read ",8,$)]))],2))),128)),n.notifications.length===0?(a(),s("div",j," No notifications yet. ")):c("",!0)])]),_:1})]),_:1})],64))}};export{z as default};
