import"./chunk-QTnfLwEv.js";import{n as e}from"./index-7yDgay5u.js";import{i as t,o as n,t as r}from"./jsx-runtime-DHSfUA5-.js";import{P as i,T as a}from"./test.id-DxQrYxPk.js";import{t as o}from"./diaryService-CNt2_Lb5.js";import{t as s}from"./trash-2-DY8nCWBX.js";import{t as c}from"./useSuccessToast-CW8oLO3e.js";import{f as l,l as u,m as d,n as f,s as p,u as m}from"./selectors-DZWoTA9D.js";import{t as h}from"./useDiaryModel-BQGj9xs8.js";import{t as g}from"./HeaderLayoutPage-CDZOzzod.js";import{t as _}from"./useDialog-CjsjDZgz.js";n();var v=r();function y(){let n=i(o),r=h(),y=_(),b=c(),x=t=>{y({title:e(`settings.membership.futureMessages.delete`,`Delete future message`),message:e(`settings.membership.futureMessages.deleteConfirm`,`Deleted messages cannot be restored.`),confirmLabel:e(`common.delete`,`Delete`),cancelLabel:e(`common.cancel`,`Cancel`),tone:`danger`,rootTestId:a.futureMessagesDeleteDialog,confirmTestId:a.futureMessagesDeleteConfirm,cancelTestId:a.futureMessagesDeleteCancel,onConfirm:()=>{n.softDeleteEntry(t),b({message:e(`diary.entryDeleted`,`Deleted`)})}})},S=m(r);return(0,v.jsx)(g,{rootClassName:t.Page.GroupedRoot,contentClassName:t.Membership.PageContent,pageTestId:a.futureMessagesPage,contentTestId:a.futureMessagesContent,header:{title:e(`settings.membership.futureMessages`,`Future messages`),showBack:!0},children:S.length===0?(0,v.jsx)(`p`,{className:t.Membership.FutureMessagesEmpty,"data-test-id":a.futureMessagesEmpty,children:e(`settings.membership.futureMessages.empty`,`No future messages yet`)}):(0,v.jsx)(`div`,{className:t.Membership.FutureMessageList,children:S.map(n=>{let i=d(r,n.notebookId),o=n.identityId?l(r,n.identityId):void 0;return(0,v.jsxs)(`div`,{className:t.Membership.FutureMessageItem,"data-test-id":a.futureMessagesItem,children:[(0,v.jsxs)(`div`,{className:t.Membership.FutureMessageBody,children:[(0,v.jsx)(`p`,{className:t.Membership.FutureMessageSummary,children:u(r,n)}),(0,v.jsxs)(`p`,{className:t.Membership.FutureMessageMeta,children:[(0,v.jsx)(`span`,{children:f(p(n))}),i&&(0,v.jsx)(`span`,{children:i.name}),o&&(0,v.jsx)(`span`,{children:o.name})]})]}),(0,v.jsx)(`button`,{className:t.Membership.FutureMessageDeleteButton,type:`button`,"aria-label":e(`settings.membership.futureMessages.delete`,`Delete future message`),"data-test-id":a.futureMessagesDelete,onClick:()=>x(n.id),children:(0,v.jsx)(s,{size:18,"aria-hidden":`true`})})]},n.id)})})})}export{y as SettingsMembershipFutureMessagesPage};
//# sourceMappingURL=future-messages-BCK7pzPP.js.map