import{r as e}from"./chunk-QTnfLwEv.js";import{n as t}from"./index-7yDgay5u.js";import{o as n,t as r}from"./jsx-runtime-DHSfUA5-.js";import{P as i,k as a}from"./test.id-DxQrYxPk.js";import{t as o}from"./diaryService-CNt2_Lb5.js";import{t as s}from"./navigationService-BNBSAd9W.js";import{t as c}from"./useDiaryModel-BQGj9xs8.js";import{t as l}from"./HeaderPage-CPQpvQQw.js";import{t as u}from"./TextInputRow-DqOYjq7o.js";var d=e(n(),1),f=r();function p(){let e=i(s),n=i(o),[r,p]=(0,d.useState)(c().profile.name??``),m=r.trim(),h=m.length>0,g=async()=>{n.updateProfileName(m),e.goBack({fallbackPath:`/settings/profile`})};return(0,f.jsx)(l,{pageTestId:a.page,contentTestId:a.content,header:{title:t(`profile.name`,`Name`),showBack:!0,right:{type:`button`,label:t(`common.save`,`Save`),disabled:!h,testId:a.save,onClick:()=>void g()}},children:(0,f.jsx)(u,{id:`profileName`,testId:a.nameInput,autoFocus:!0,placeholder:t(`profile.namePlaceholder`,`Enter a name`),value:r,onChange:p})})}export{p as SettingsNamePage};
//# sourceMappingURL=name-BjT5-4xi.js.map