1import{j as e}from"./vendor-radix-D95_QOwI.js";import{r as l}from"./vendor-react-D8kazXLH.js";import{S as u}from"./ServicesLayout-D1RiQof3.js";import{u as h}from"./useServiceBusiness-Ck4F8qfX.js";import{u as p,L as m,C as j,a5 as n,V as d,B as g}from"./index-C8HR-Dmp.js";import{T as b}from"./textarea-BC7XknAn.js";import{t as f}from"./use-toast-BavRfbP9.js";import{S as y}from"./save-Vq8BiGe1.js";import"./building-2-9nPn4v-_.js";import"./arrow-left-BiyM080f.js";import"./vendor-shopify-BAYZQhWM.js";import"./vendor-data-DTxAkKxM.js";import"./vendor-charts-Bku11YKm.js";function R(){const{t:a}=p(),{business:r,loading:v,updateBusiness:_}=h(),[i,t]=l.useState({}),[c,o]=l.useState(!1);if(l.useEffect(()=>{r&&t({business_name:r.business_name,description:r.description??"",phone:r.phone??"",email:r.email??"",website_url:r.website_url??"",address_street:r.address_street??"",address_city:r.address_city??"",address_postal_code:r.address_postal_code??"",address_country:r.address_country??"FR"})},[r]),v||!r)return e.jsx(u,{children:e.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:e.jsx(m,{className:"h-8 w-8 animate-spin text-primary"})})});const x=async()=>{o(!0);const s=await _(i);o(!1),f({title:s?a("services_biz_saved","Profile saved"):a("services_biz_err","Save failed"),variant:s?"default":"destructive"})};return e.jsx(u,{children:e.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-8",children:[e.jsx("h1",{className:"text-3xl font-black mb-2",children:a("services_biz_title","Business profile")}),e.jsx("p",{className:"text-muted-foreground mb-8",children:a("services_biz_sub","Information AI engines use to recommend you.")}),e.jsxs(j,{className:"p-6 space-y-5",children:[e.jsxs("div",{children:[e.jsx(n,{children:a("services_biz_name","Business name")}),e.jsx(d,{value:i.business_name??"",onChange:s=>t({...i,business_name:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(n,{children:a("services_biz_desc","Description")}),e.jsx(b,{rows:4,value:i.description,onChange:s=>t({...i,description:s.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(n,{children:a("services_biz_phone","Phone")}),e.jsx(d,{value:i.phone,onChange:s=>t({...i,phone:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(n,{children:a("services_biz_email","Public email")}),e.jsx(d,{type:"email",value:i.email,onChange:s=>t({...i,email:s.target.value})})]})]}),e.jsxs("div",{children:[e.jsx(n,{children:a("services_biz_website","Website")}),e.jsx(d,{type:"url",value:i.website_url,onChange:s=>t({...i,website_url:s.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(n,{children:a("services_biz_street","Street")}),e.jsx(d,{value:i.address_street,onChange:s=>t({...i,address_street:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(n,{children:a("services_biz_city","City")}),e.jsx(d,{value:i.address_city,onChange:s=>t({...i,address_city:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(n,{children:a("services_biz_postal","Postal code")}),e.jsx(d,{value:i.address_postal_code,onChange:s=>t({...i,address_postal_code:s.target.value})})]}),e.jsxs("div",{children:[e.jsx(n,{children:a("services_biz_country","Country (ISO 2)")}),e.jsx(d,{maxLength:2,value:i.address_country,onChange:s=>t({...i,address_country:s.target.value.toUpperCase()})})]})]}),e.jsxs(g,{onClick:x,disabled:c,className:"gap-2 w-full md:w-auto",children:[c?e.jsx(m,{className:"h-4 w-4 animate-spin"}):e.jsx(y,{className:"h-4 w-4"}),a("services_biz_save","Save profile")]})]})]})})}export{R 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.