import"./chunk-QTnfLwEv.js";import{n as e}from"./index-7yDgay5u.js";import{i as t,o as n,r,t as i}from"./jsx-runtime-DHSfUA5-.js";import{P as a,x as o}from"./test.id-DxQrYxPk.js";import{t as s}from"./navigationService-BNBSAd9W.js";import{t as c}from"./PageHeader-CzIJsNRF.js";import{i as l,r as u}from"./selectors-DZWoTA9D.js";import{t as d}from"./useDiaryModel-BQGj9xs8.js";import{t as f}from"./identityConfig-CizB5LHH.js";import{t as p}from"./usePreference-3fMY0uE5.js";import{t as m}from"./IdentityItem-toejfr9O.js";n();var h=i();function g(){let n=d(),i=a(s),g=u(n),_=l(n).length>0,[v,y]=p(f);return(0,h.jsxs)(`div`,{className:t.Page.GroupedRoot,"data-test-id":o.page,children:[(0,h.jsx)(c,{title:e(`identity.title`,`Identities`),showBack:!0,right:{type:`icon`,icon:`plus`,label:e(`identity.add`,`New identity`),testId:o.add,onClick:()=>i.navigate({path:`/identities/new`})}}),(0,h.jsxs)(`main`,{className:r(t.Page.Content,t.Cell.GroupStack),"data-test-id":o.content,children:[(0,h.jsxs)(`label`,{className:r(t.Cell.InsetGroup,t.IdentityListPage.SwitchRow),children:[(0,h.jsx)(`span`,{className:t.IdentityListPage.SwitchLabel,children:e(`identity.chatEntry`,`Use identities in chat`)}),(0,h.jsx)(`input`,{type:`checkbox`,className:t.Choice.Input,"data-test-id":o.chatEntrySwitch,checked:v.chatEntryEnabled,onChange:e=>void y({chatEntryEnabled:e.target.checked})})]}),(0,h.jsxs)(`div`,{children:[g.length>0?(0,h.jsx)(`div`,{className:t.Cell.InsetGroup,"data-test-id":o.list,children:g.map(e=>(0,h.jsx)(m,{model:n,identity:e,testId:o.item,nameTestId:o.itemName,onClick:()=>i.navigate({path:`/identity/${e.id}`})},e.id))}):(0,h.jsx)(`div`,{className:r(t.Cell.InsetGroup,t.IdentityListPage.Empty),"data-test-id":o.empty,children:e(`identity.empty`,`No identities yet. Tap + to add one.`)}),_&&(0,h.jsx)(`button`,{className:t.IdentityListPage.ArchivedLink,type:`button`,"data-test-id":o.viewArchived,onClick:()=>i.navigate({path:`/identities/archived`}),children:e(`identity.viewArchived`,`View archived`)})]})]})]})}export{g as IdentitiesPage};
//# sourceMappingURL=identities-RzukrA-H.js.map