dsql-admin/dsql-app/.local_dist/server/chunks/7488.js

1 line
6.1 KiB
JavaScript
Raw Normal View History

2024-12-08 19:56:57 +00:00
"use strict";exports.id=7488,exports.ids=[7488],exports.modules={84851:(e,a,s)=>{let t;s.d(a,{A:()=>u});var l=s(8732),r=s(82015),i=s.n(r),n=s(63715),m=s(64535),d=s(32415),o=s(13737),c=s(77826);function u({targetDb:e,database:a,user:s,userImage:r,setUserImage:u}){let[p,x]=i().useState(null),[h,v]=i().useState(!1);return(0,l.jsxs)(i().Fragment,{children:[h&&(0,l.jsx)(d.A,{}),p&&(0,l.jsx)(m.A,{message:p}),(0,l.jsx)("h3",{className:"m-0 text-lg font-semibold mb-1 text-slate-600 mt-4",children:"User information"}),(0,l.jsx)("div",{className:"flex flex-col items-start gap-0.5 w-full",children:(0,l.jsx)(o.A,{title:"First Name",inputType:"text",name:"first_name",autoComplete:"given-name",onInputHandler:e=>{let a=e.target;a.value.match(/./)?(a.classList.remove("warning"),x(null)):a.classList.add("warning")},required:!0})}),(0,l.jsxs)("div",{className:"flex flex-col items-start gap-0.5 w-full",children:[(0,l.jsx)("label",{htmlFor:"last_name",children:"Last Name"}),(0,l.jsx)("input",{type:"text",name:"last_name",id:"last_name",placeholder:"Last Name",autoComplete:"family-name",onInput:e=>{let a=e.target;a.value.match(/./)?(a.classList.remove("warning"),x(null)):a.classList.add("warning")},required:!0})]}),(0,l.jsxs)("div",{className:"flex flex-col items-start gap-0.5 w-full",children:[(0,l.jsx)("label",{htmlFor:"username",children:"Username"}),(0,l.jsx)("input",{type:"text",name:"username",id:"username",placeholder:"Username",autoComplete:"username",onInput:a=>{let s=a.target;s.value.match(/./)?(s.classList.remove("warning"),x(null)):s.classList.add("warning"),window.clearTimeout(t),t=setTimeout(()=>{(0,n.A)(`/api/checkDuplicateData?type=username&value=${s.value}&tableName=users&dbFullName=${e}`).then(e=>{e?.result?(x("Username Already Exists"),s.classList.add("warning")):(x(null),s.classList.remove("warning"))})},300)}})]}),(0,l.jsxs)("div",{className:"flex flex-col items-start gap-0.5 w-full",children:[(0,l.jsx)("label",{htmlFor:"email_address",children:"Email Address"}),(0,l.jsx)("input",{type:"email",name:"email_address",id:"email_address",placeholder:"Email Address",autoComplete:"email",onInput:a=>{window.clearTimeout(t);let s=a.target;t=setTimeout(()=>{(0,n.A)(`/api/checkDuplicateData?type=email&value=${s.value}&tableName=users&dbFullName=${e}`).then(e=>{e?.result?(x("Email Already Exists"),s.classList.add("warning")):(x(null),s.classList.remove("warning"))})},300)},required:!0})]}),(0,l.jsx)(o.A,{title:"Phone Number",inputType:"text",name:"phone",autoComplete:"tel"}),(0,l.jsx)(o.A,{title:"Address",name:"address",autoComplete:"address"}),(0,l.jsxs)("div",{className:"flex-wrap xl:flex-nowrap",children:[(0,l.jsx)(o.A,{title:"City",name:"city",autoComplete:"city"}),(0,l.jsx)(o.A,{title:"State",name:"state",autoComplete:"state"}),(0,l.jsx)(o.A,{title:"Country",name:"country",autoComplete:"country"}),(0,l.jsx)(o.A,{title:"Zip Code",name:"zip_code",autoComplete:"zip_code"})]}),(0,l.jsxs)("div",{className:"flex flex-col items-start gap-0.5 w-full",children:[(0,l.jsx)("label",{htmlFor:"password",children:"Password"}),(0,l.jsx)("input",{type:"password",name:"password",id:"password",placeholder:"Password",required:!0})]}),(0,l.jsxs)("div",{className:"flex flex-col items-start gap-0.5 w-full",children:[(0,l.jsx)("label",{htmlFor:"confirm_password",children:"Confirm Password"}),(0,l.jsx)("input",{type:"password",name:"confirm_password",id:"confirm_password",placeholder:"Confirm Password",onInput:e=>{let a=e.target;a.closest("form")?.password.value===a.value?a.classList.remove("warning"):a.classList.add("warning")},required:!0})]}),(0,l.jsxs)("div",{className:"paper",children:[(0,l.jsx)("h3",{className:"m-0 text-lg font-semibold mb-1 text-slate-600",children:"User Image"}),(0,l.jsx)(c.A,{userImage:r,setUserImage:u,className:"w-full"})]})]})}},64535:(e,a,s)=>{s.d(a,{A:()=>l});var t=s(8732);function l({message:e}){return(0,t.jsxs)("div",{className:"p-2 bg-orange-50 w-full justify-center rounded text-sm text-orange-700 border border-orange-400 border-solid",children:[(0,t.jsx)("img",{src:"/images/warning.png",alt:"Warning Image Icon",width: