/
opt
/
canhelp
/
apps
/
web
/
.next
/
static
/
chunks
/
app
/
delete-account
/
/opt/canhelp/apps/web/.next/static/chunks/app/delete-account
mkdir
upload
Name
Size
Mode
Actions
page-9330a202115b2dda.js
4498
0644
edit
dl
rm
Edit:
/opt/canhelp/apps/web/.next/static/chunks/app/delete-account/page-9330a202115b2dda.js
(4498B)
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4466],{1592:(e,t,s)=>{"use strict";s.d(t,{CI:()=>l,Hh:()=>n,Jv:()=>a,wV:()=>d,yK:()=>r});let r=(0,s(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:a,signOut:l,signUp:n,useSession:d}=r},5845:(e,t,s)=>{Promise.resolve().then(s.bind(s,9623))},9623:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>i});var r=s(4568),a=s(7620),l=s(9664),n=s.n(l),d=s(9906),c=s(1592),o=s(2982);function i(){let{t:e}=(0,d.Y)(),{data:t}=(0,c.wV)(),[s,l]=(0,a.useState)(""),[i,x]=(0,a.useState)(!1),[m,u]=(0,a.useState)(!1),[h,b]=(0,a.useState)(!1),[g,p]=(0,a.useState)(null),j=async e=>{if(e.preventDefault(),i&&!m){u(!0),p(null);try{await (0,o.mq)({type:"delete_account",subject:"Account deletion request",body:s.trim()||"No reason provided."}),b(!0)}catch(e){var t;p(null!=(t=null==e?void 0:e.message)?t:"Error")}finally{u(!1)}}};return(0,r.jsx)("main",{className:"py-12 px-4 sm:px-6",children:(0,r.jsxs)("div",{className:"max-w-lg mx-auto bg-white rounded-2xl shadow-sm border border-gray-100 px-6 sm:px-10 py-10",children:[(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsxs)(n(),{href:"/",className:"text-sm text-green-600 hover:underline",children:["← ",e("nav.home")]})}),(0,r.jsx)("h1",{className:"text-2xl font-extrabold text-gray-900 mb-2",children:e("delete_account.title")}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mb-8",children:e("delete_account.subtitle")}),h?(0,r.jsxs)("div",{className:"rounded-xl bg-green-50 border border-green-200 p-6 text-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-4",children:(0,r.jsx)("svg",{className:"w-6 h-6 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),(0,r.jsx)("h2",{className:"text-base font-semibold text-green-800 mb-1",children:e("delete_account.success_title")}),(0,r.jsx)("p",{className:"text-sm text-green-700",children:e("delete_account.success_body")})]}):(null==t?void 0:t.user)?(0,r.jsxs)("form",{onSubmit:j,className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex gap-3 rounded-xl bg-red-50 border border-red-200 p-4",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-red-500 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,r.jsx)("p",{className:"text-sm text-red-700",children:e("delete_account.warning")})]}),(0,r.jsx)("div",{className:"rounded-xl bg-gray-50 border border-gray-200 px-4 py-3 text-sm text-gray-700",children:(0,r.jsx)("span",{className:"font-medium",children:t.user.email})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1.5",children:e("delete_account.reason_label")}),(0,r.jsx)("textarea",{value:s,onChange:e=>l(e.target.value),placeholder:e("delete_account.reason_placeholder"),rows:4,maxLength:2e3,className:"w-full rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-green-500 resize-none"})]}),(0,r.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:i,onChange:e=>x(e.target.checked),className:"mt-0.5 w-4 h-4 rounded border-gray-300 text-red-600 focus:ring-red-500 shrink-0"}),(0,r.jsx)("span",{className:"text-sm text-gray-700",children:e("delete_account.confirm_label")})]}),g&&(0,r.jsx)("p",{className:"text-sm text-red-600",children:g}),(0,r.jsx)("button",{type:"submit",disabled:!i||m,className:"w-full py-3 rounded-xl bg-red-600 hover:bg-red-700 disabled:opacity-40 disabled:cursor-not-allowed text-white font-semibold text-sm transition",children:e(m?"delete_account.submitting":"delete_account.submit")})]}):(0,r.jsxs)("div",{className:"rounded-xl bg-amber-50 border border-amber-200 p-6 text-center",children:[(0,r.jsx)("p",{className:"text-sm text-amber-800 mb-4",children:e("delete_account.login_required")}),(0,r.jsx)(n(),{href:"/login",className:"inline-flex items-center gap-2 px-5 py-2.5 bg-green-600 hover:bg-green-700 text-white text-sm font-semibold rounded-xl transition",children:e("delete_account.login_btn")})]})]})})}}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=5845)),_N_E=e.O()}]);
Save
cmd:
run