mirror of
https://github.com/hanzobot/adnexus.git
synced 2026-10-30 19:44:10 +00:00
2 lines
7.4 KiB
JavaScript
2 lines
7.4 KiB
JavaScript
import{j as e,r as p}from"./ui-SA1K2VdO.js";import{B as b,u as v,F as N}from"./index-BBRaFEzF.js";import{W as w,x as q}from"./utils-BOogt4zp.js";import{b as k}from"./vendor-khT4bKqW.js";const S=({field:r,value:i,onChange:t,onFileChange:l})=>{const{id:s,label:d,type:u,placeholder:m,required:o,accept:f}=r;return u==="textarea"?e.jsxs("div",{className:"mb-6",children:[e.jsxs("label",{htmlFor:s,className:"block text-sm font-medium text-black mb-1",children:[d," ",o&&e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("textarea",{id:s,rows:4,className:"w-full border border-gray-300 rounded-md p-3 focus:ring-2 focus:ring-accent focus:border-accent",value:i||"",onChange:t,placeholder:m,required:o})]}):u==="file"?e.jsxs("div",{className:"mb-6",children:[e.jsxs("label",{htmlFor:s,className:"block text-sm font-medium text-black mb-1",children:[d," ",o&&e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("div",{className:"mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md",children:e.jsxs("div",{className:"space-y-1 text-center",children:[e.jsx(w,{className:"mx-auto h-12 w-12 text-gray-400"}),e.jsxs("div",{className:"flex text-sm text-gray-600",children:[e.jsxs("label",{htmlFor:s,className:"relative cursor-pointer rounded-md font-medium text-accent hover:text-accent/80",children:[e.jsx("span",{children:"Upload a file"}),e.jsx("input",{id:s,name:s,type:"file",className:"sr-only",accept:f,onChange:l})]}),e.jsx("p",{className:"pl-1",children:"or drag and drop"})]}),e.jsx("p",{className:"text-xs text-gray-500",children:f?.split(",").join(", ").replace(/\./g,"")}),i&&e.jsxs("p",{className:"text-sm text-accent flex items-center justify-center mt-2",children:[e.jsx(q,{size:16,className:"mr-1"}),i.name]})]})})]}):e.jsxs("div",{className:"mb-6",children:[e.jsxs("label",{htmlFor:s,className:"block text-sm font-medium text-black mb-1",children:[d," ",o&&e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{id:s,type:u,className:"w-full border border-gray-300 rounded-md p-3 focus:ring-2 focus:ring-accent focus:border-accent",value:i||"",onChange:t,placeholder:m,required:o})]})},F=({section:r,formData:i,handleInputChange:t,handleFileChange:l})=>e.jsx(e.Fragment,{children:r.fields.map(s=>e.jsx(S,{field:s,value:i[s.id],onChange:t,onFileChange:l},s.id))}),C=({currentStep:r,totalSteps:i,title:t})=>e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-black",children:t}),e.jsxs("span",{className:"text-sm text-black/60",children:["Step ",r+1," of ",i]})]}),e.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2 mb-4",children:e.jsx("div",{className:"bg-accent h-2 rounded-full transition-all duration-300 ease-in-out",style:{width:`${(r+1)/i*100}%`}})})]}),P=({currentStep:r,totalSteps:i,prevStep:t,nextStep:l,isSubmitting:s})=>e.jsxs("div",{className:"flex justify-between mt-8",children:[r>0&&e.jsx(b,{type:"button",variant:"outline",onClick:t,children:"Previous"}),r<i-1?e.jsx(b,{type:"button",className:"ml-auto",onClick:l,children:"Next"}):e.jsx(b,{type:"submit",className:"ml-auto bg-accent hover:bg-accent/90 text-white",disabled:s,children:s?"Submitting...":"Submit"})]}),c=[{title:"Business Information",fields:[{id:"companyName",label:"What's your company's official name?",type:"text",required:!0},{id:"businessDescription",label:"Provide a short description of your business and core offering.",type:"textarea",required:!0},{id:"targetAudience",label:"Describe your target audience in detail (industry, demographics, preferences).",type:"textarea",required:!0},{id:"websiteGoal",label:"What is your primary goal for this website? (e.g., sales, leads, information, credibility).",type:"textarea",required:!0}]},{title:"Design Preferences",fields:[{id:"websitesAdmired",label:"List 3-5 websites you admire and briefly explain why.",type:"textarea",required:!0},{id:"requiredPages",label:"What main pages or sections must your website include?",type:"textarea",required:!0},{id:"brandGuidelines",label:"Provide your brand guidelines: colors, fonts, logo files.",type:"textarea",required:!0},{id:"toneStyle",label:"What is the tone and style you'd like the website copy to reflect? (e.g., professional, casual, persuasive).",type:"textarea",required:!0},{id:"visualStyle",label:"List any specific imagery or visual style you want included (minimalist, bold, luxury, tech-focused).",type:"textarea",required:!0}]},{title:"Content & Technical Requirements",fields:[{id:"existingContent",label:"Do you have existing content ready? If not, outline key messages you'd like AI to generate clearly.",type:"textarea",required:!0},{id:"seoTerms",label:"Share any key phrases or SEO terms your website should emphasize.",type:"textarea",required:!1},{id:"socialMediaLinks",label:"Provide social media and relevant external links to include.",type:"textarea",required:!1},{id:"productsServices",label:"Outline your products/services clearly with key benefits.",type:"textarea",required:!0},{id:"technicalIntegrations",label:"Any technical integrations required? (booking, payments, forms, CRM).",type:"textarea",required:!1}]},{title:"Project Timeline & Additional Info",fields:[{id:"timeline",label:"Preferred timeline or deadlines?",type:"text",required:!1},{id:"competitors",label:"List competitors' websites or businesses you wish to differentiate from.",type:"textarea",required:!1},{id:"additionalRequests",label:"Any additional requests or inspiration you want incorporated into your project?",type:"textarea",required:!1},{id:"designBrief",label:"Upload Design Brief, branding Document, pitch decks, any content with a visual representation of your brand",type:"file",accept:".jpg,.png,.jpeg,.svg,.pdf",required:!1},{id:"logo",label:"Upload your logo",type:"file",accept:".jpg,.png,.svg",required:!1}]}],A=()=>{const r=k(),{toast:i}=v(),[t,l]=p.useState(0),[s,d]=p.useState({}),[u,m]=p.useState(!1),o=a=>{const{id:x,value:n}=a.target;d(j=>({...j,[x]:n}))},f=a=>{if(a.target.files&&a.target.files[0]){const x=a.target.files[0];d(n=>({...n,[a.target.id]:x}))}},h=()=>{const x=c[t].fields.filter(n=>n.required);for(const n of x)if(!s[n.id]){i({title:"Missing information",description:`Please fill in the field: ${n.label}`,variant:"destructive"});return}t<c.length-1&&(l(t+1),window.scrollTo(0,0))},y=()=>{t>0&&(l(t-1),window.scrollTo(0,0))},g=async a=>{a.preventDefault(),m(!0),setTimeout(()=>{m(!1),i({title:"Onboarding complete!",description:"Thank you for providing your information. We'll be in touch soon!"}),r("/onboarding-success")},2e3)};return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx("main",{className:"flex-grow bg-beige-50 py-16",children:e.jsx("div",{className:"container-custom",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold mb-2 text-black",children:"Help Us Create Your Perfect Website"}),e.jsx("p",{className:"text-lg text-black/70",children:"Please fill out this onboarding form as thoroughly as possible so we can deliver the best results for your project."})]}),e.jsxs("div",{className:"bg-white p-8 rounded-xl shadow-sm",children:[e.jsx(C,{currentStep:t,totalSteps:c.length,title:c[t].title}),e.jsxs("form",{onSubmit:g,children:[e.jsx(F,{section:c[t],formData:s,handleInputChange:o,handleFileChange:f}),e.jsx(P,{currentStep:t,totalSteps:c.length,prevStep:y,nextStep:h,isSubmitting:u})]})]})]})})}),e.jsx(N,{})]})};export{A as default};
|