PageSourceSearch

https://yachtcrewcenter.com/assets/Settings-YGCpvQuG.js

js yachtcrewcenter.com collected 2026-10-07 02:11:07 UTC 7,919 bytes, 3 lines download raw bytes

1import{ce as y,r as c,j as e,X as N,t as x}from"./index-GIzFOf59.js";import{u as j}from"./useProfile-CsJDIppP.js";import{C as w}from"./circle-check-big-nBaZdbMQ.js";import{S as v}from"./square-pen-DVRyExfc.js";import{S as k}from"./save-0CJs3sa5.js";const B=()=>{const{user:l}=y(),{updateBusinessProfile:u}=j(),[a,i]=c.useState(!1),[t,n]=c.useState({businessName:l?.business?.businessName||"",businessEmail:l?.business?.email||"",businessPhone:l?.business?.phone||"",website:l?.business?.website||"",address:l?.business?.address||{street:"",zipcode:"",city:"",state:"",country:""}}),[p,h]=c.useState(t),m=(s,o)=>{n(d=>({...d,[s]:o}))},r=(s,o)=>{n(d=>({...d,address:{...d.address,[s]:o}}))},g=async()=>{try{await u.mutateAsync(t),x.success("Business profile updated successfully"),i(!1),h(t)}catch(s){const o=s?.response?.data?.message||"Failed to update business profile";x.error(o)}},f=()=>{n(p),i(!1)},b=u.isPending;return e.jsxs("div",{className:"p-4 md:p-6 lg:p-8 max-w-7xl mx-auto",children:[e.jsx("h1",{className:"text-3xl font-semibold text-slate-900 mb-6",children:"Distributor Settings"}),!a&&e.jsxs("div",{className:"mb-6 p-4 rounded-lg bg-emerald-50 border border-emerald-200 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(w,{className:"w-5 h-5 text-emerald-600"}),e.jsx("p",{className:"text-sm text-emerald-900",children:"Your settings are up to date."})]}),e.jsxs("button",{onClick:()=>i(!0),className:`flex items-center gap-2 px-4 py-2 text-sm font-medium 
2            text-emerald-700 border border-emerald-300 rounded-lg 
3            hover:bg-emerald-100 transition-colors cursor-pointer`,children:[e.jsx(v,{className:"w-4 h-4"}),"Edit Settings"]})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6 mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-slate-900 mb-6",children:"Business Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"businessName",className:"block text-sm font-medium text-slate-700",children:"Business Name"}),e.jsx("input",{type:"text",id:"businessName",value:t.businessName,disabled:!0,className:"w-full px-4 py-2.5 rounded-lg border border-slate-300 bg-gray-100 text-slate-600 cursor-not-allowed transition-colors",placeholder:"Enter business name"}),e.jsx("p",{className:"text-xs text-slate-500",children:"Business name cannot be changed"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"businessPhone",className:"block text-sm font-medium text-slate-700",children:"Business Phone"}),e.jsx("input",{type:"tel",id:"businessPhone",value:t.businessPhone,onChange:s=>m("businessPhone",s.target.value),disabled:!a,className:"w-full px-4 py-2.5 rounded-lg border border-slate-300 bg-slate-50 text-slate-900 placeholder-slate-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/20 focus:bg-white disabled:opacity-60 disabled:cursor-not-allowed transition-colors",placeholder:"Enter phone number"})]}),e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx("label",{htmlFor:"businessEmail",className:"block text-sm font-medium text-slate-700",children:"Business Email"}),e.jsx("input",{type:"email",id:"businessEmail",disabled:!0,value:t.businessEmail,className:"w-full px-4 py-2.5 rounded-lg border border-slate-300 bg-slate-50 text-slate-900 placeholder-slate-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/20 focus:bg-white disabled:opacity-60 disabled:cursor-not-allowed transition-colors",placeholder:"[email protected]"})]}),e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx("label",{htmlFor:"website",className:"block text-sm font-medium text-slate-700",children:"Website"}),e.jsx("input",{type:"url",id:"website",value:t.website,onChange:s=>m("website",s.target.value),disabled:!a,className:"w-full px-4 py-2.5 rounded-lg border border-slate-300 bg-slate-50 text-slate-900 placeholder-slate-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/20 focus:bg-white disabled:opacity-60 disabled:cursor-not-allowed transition-colors",placeholder:"https://example.com"})]})]})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-slate-200 p-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-slate-900 mb-6",children:"Address Information"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2 md:col-span-2",children:[e.jsx("label",{htmlFor:"street",className:"block text-sm font-medium text-slate-700",children:"Street Address"}),e.jsx("input",{type:"text",id:"street",value:t.address.street,onChange:s=>r("street",s.target.value),disabled:!a,className:"w-full px-4 py-2.5 rounded-lg border border-slate-300 bg-slate-50 text-slate-900 placeholder-slate-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/20 focus:bg-white disabled:opacity-60 disabled:cursor-not-allowed transition-colors",placeholder:"123 Business St"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"city",className:"block text-sm font-medium text-slate-700",children:"City"}),e.jsx("input",{type:"text",id:"city",value:t.address.city,onChange:s=>r("city",s.target.value),disabled:!a,className:"w-full px-4 py-2.5 rounded-lg border border-slate-300 bg-slate-50 text-slate-900 placeholder-slate-400 focus:border-sky-500 focus: ring-2 focus:ring-sky-500/20 focus:bg-white disabled:opacity-60 disabled:cursor-not-allowed transition-colors",placeholder:"Enter city"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"state",className:"block text-sm font-medium text-slate-700",children:"State/Province"}),e.jsx("input",{type:"text",id:"state",value:t.address.state,onChange:s=>r("state",s.target.value),disabled:!a,className:"w-full px-4 py-2.5 rounded-lg border border-slate-300 bg-slate-50 text-slate-900 placeholder-slate-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/20 focus:bg-white disabled:opacity-60 disabled:cursor-not-allowed transition-colors",placeholder:"Enter state"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"zipcode",className:"block text-sm font-medium text-slate-700",children:"ZIP/Postal Code"}),e.jsx("input",{type:"text",id:"zipcode",value:t.address.zipcode,onChange:s=>r("zipcode",s.target.value),disabled:!a,className:"w-full px-4 py-2.5 rounded-lg border border-slate-300 bg-slate-50 text-slate-900 placeholder-slate-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/20 focus:bg-white disabled:opacity-60 disabled:cursor-not-allowed transition-colors",placeholder:"Enter ZIP code"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{htmlFor:"country",className:"block text-sm font-medium text-slate-700",children:"Country"}),e.jsx("input",{type:"text",id:"country",value:t.address.country,onChange:s=>r("country",s.target.value),disabled:!a,className:"w-full px-4 py-2.5 rounded-lg border border-slate-300 bg-slate-50 text-slate-900 placeholder-slate-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/20 focus:bg-white disabled:opacity-60 disabled:cursor-not-allowed transition-colors",placeholder:"Enter country"})]})]})]}),a&&e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-4",children:[e.jsxs("button",{onClick:f,className:"flex items-center gap-2 px-6 py-2.5 text-sm font-medium text-slate-700 bg-white border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:[e.jsx(N,{className:"w-4 h-4"}),"Cancel"]}),e.jsxs("button",{onClick:g,disabled:b,className:"flex items-center gap-2 px-6 py-2.5 text-sm font-medium text-white bg-sky-600 rounded-lg hover:bg-sky-700 disabled:opacity-60 disabled:cursor-not-allowed shadow-sm transition-colors",children:[e.jsx(k,{className:"w-4 h-4"}),b?"Saving...":"Save Changes"]})]})]})};export{B as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.