PageSourceSearch

https://app.designhivestudio.ai/assets/Contact-CwL-jsf7.js

js designhivestudio.ai collected 2026-10-05 14:38:17 UTC 8,864 bytes, 1 lines download raw bytes

1import{r as h,j as e}from"./react-CBsl08bt.js";import{s as S,b as w,H as f,B as N,aJ as x,I as g,J as p}from"./index-Znlz9Whf.js";import{C as i,d as c,a as C,b as k,c as I}from"./card-3cO3APWD.js";import{T as F}from"./textarea-ByZ0cIPM.js";import{S as E,a as D,d as q,b as M,c as H}from"./select-BizGM3T-.js";import{k as J,aK as T,aL as U,au as O,aa as _,ai as A}from"./icons-CgIhAgVC.js";import"./index-BdQq_4o_.js";import"./index-DJmASvcX.js";const L=async a=>{try{const{data:t,error:l}=await S.functions.invoke("sendEmail",{body:a});if(l)throw l;if(!t)throw new Error("Failed to send email");if(a.userId){const o=`sent_emails_${a.userId}`,d=JSON.parse(localStorage.getItem(o)||"[]");d.push({id:crypto.randomUUID(),...a,timestamp:Date.now(),status:"sent"}),localStorage.setItem(o,JSON.stringify(d))}return t}catch(t){if(console.error("Error sending email:",t),a.userId){const l=`sent_emails_${a.userId}`,o=JSON.parse(localStorage.getItem(l)||"[]");o.push({id:crypto.randomUUID(),...a,timestamp:Date.now(),status:"failed",error:String(t)}),localStorage.setItem(l,JSON.stringify(o))}return{success:!1,message:t.message}}},z=()=>{var b;const{user:a}=w(),[t,l]=h.useState(!1),[o,d]=h.useState(!1),[r,j]=h.useState({name:((b=a==null?void 0:a.user_metadata)==null?void 0:b.full_name)||"",email:(a==null?void 0:a.email)||"",category:"",subject:"",message:""}),m=(s,u)=>{j(n=>({...n,[s]:u}))},v=async s=>{if(s.preventDefault(),!r.name||!r.email||!r.subject||!r.message){p.error("Please fill in all required fields.");return}l(!0);try{const u=r.category?`[${r.category}] ${r.subject}`:r.subject,n=await L({name:r.name,email:r.email,subject:u,message:r.message,userId:a==null?void 0:a.id});if((n==null?void 0:n.success)===!1)throw new Error(n.message||"Failed to send message");d(!0),p.success("Message sent successfully!")}catch(u){console.error("Failed to submit contact form:",u),p.error("Failed to send message. Please try again later.")}finally{l(!1)}},y=["General Enquiry","Billing & Payments","Technical Support","Feature Request","Bug Report","Account Issue","Partnership","Other"];return o?e.jsxs(e.Fragment,{children:[e.jsx(f,{children:e.jsx("title",{children:"Contact Support - Design Hive"})}),e.jsx("div",{className:"container mx-auto px-4 py-16 max-w-2xl",children:e.jsx(i,{className:"bg-card border-border text-center",children:e.jsxs(c,{className:"pt-12 pb-12 space-y-4",children:[e.jsx("div",{className:"mx-auto w-16 h-16 bg-green-500/10 rounded-full flex items-center justify-center",children:e.jsx(J,{className:"h-8 w-8 text-green-500"})}),e.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Message Sent!"}),e.jsxs("p",{className:"text-muted-foreground max-w-md mx-auto",children:["Thank you for reaching out. Our support team will get back to you within 24 hours at ",e.jsx("span",{className:"text-hive-gold",children:r.email}),"."]}),e.jsx(N,{onClick:()=>{d(!1),j(s=>({...s,category:"",subject:"",message:""}))},variant:"outline",className:"mt-4 border-hive-gold text-hive-gold hover:bg-hive-gold/10",children:"Send Another Message"})]})})})]}):e.jsxs(e.Fragment,{children:[e.jsxs(f,{children:[e.jsx("title",{children:"Contact Support - Design Hive"}),e.jsx("meta",{name:"description",content:"Get in touch with the Design Hive support team for any enquiries, technical support, or feedback."})]}),e.jsxs("div",{className:"container mx-auto px-4 py-12 max-w-5xl",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsxs("h1",{className:"text-3xl md:text-4xl font-bold text-foreground mb-3",children:["Contact ",e.jsx("span",{className:"text-hive-gold",children:"Support"})]}),e.jsx("p",{className:"text-muted-foreground max-w-xl mx-auto",children:"Have a question or need help? Fill out the form below and our team will get back to you as soon as possible."})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(i,{className:"bg-card border-border",children:e.jsxs(c,{className:"pt-6 flex items-start gap-4",children:[e.jsx("div",{className:"p-2 bg-hive-gold/10 rounded-lg shrink-0",children:e.jsx(T,{className:"h-5 w-5 text-hive-gold"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground text-sm",children:"Email Us"}),e.jsx("a",{href:"mailto:[email protected]",className:"text-muted-foreground text-sm hover:text-hive-gold transition-colors",children:"[email protected]"})]})]})}),e.jsx(i,{className:"bg-card border-border",children:e.jsxs(c,{className:"pt-6 flex items-start gap-4",children:[e.jsx("div",{className:"p-2 bg-hive-gold/10 rounded-lg shrink-0",children:e.jsx(U,{className:"h-5 w-5 text-hive-gold"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground text-sm",children:"Location"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Ryde, NSW 2112, Australia"})]})]})}),e.jsx(i,{className:"bg-card border-border",children:e.jsxs(c,{className:"pt-6 flex items-start gap-4",children:[e.jsx("div",{className:"p-2 bg-hive-gold/10 rounded-lg shrink-0",children:e.jsx(O,{className:"h-5 w-5 text-hive-gold"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground text-sm",children:"Response Time"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"We typically respond within 24 hours"})]})]})}),e.jsx(i,{className:"bg-card border-border",children:e.jsxs(c,{className:"pt-6 flex items-start gap-4",children:[e.jsx("div",{className:"p-2 bg-hive-gold/10 rounded-lg shrink-0",children:e.jsx(_,{className:"h-5 w-5 text-hive-gold"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-foreground text-sm",children:"Live Chat"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Use our AI chatbot for instant help with common questions"})]})]})})]}),e.jsx("div",{className:"lg:col-span-2",children:e.jsxs(i,{className:"bg-card border-border",children:[e.jsxs(C,{children:[e.jsx(k,{className:"text-foreground",children:"Send Us a Message"}),e.jsx(I,{className:"text-muted-foreground",children:"Fill out the form and we'll get back to you shortly."})]}),e.jsx(c,{children:e.jsxs("form",{onSubmit:v,className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(x,{htmlFor:"name",className:"text-foreground",children:["Name ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx(g,{id:"name",placeholder:"Your name",value:r.name,onChange:s=>m("name",s.target.value),className:"bg-background border-border text-foreground placeholder:text-muted-foreground",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(x,{htmlFor:"email",className:"text-foreground",children:["Email ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx(g,{id:"email",type:"email",placeholder:"[email protected]",value:r.email,onChange:s=>m("email",s.target.value),className:"bg-background border-border text-foreground placeholder:text-muted-foreground",required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(x,{htmlFor:"category",className:"text-foreground",children:"Category"}),e.jsxs(E,{value:r.category,onValueChange:s=>m("category",s),children:[e.jsx(D,{className:"bg-background border-border text-foreground",children:e.jsx(q,{placeholder:"Select a category"})}),e.jsx(M,{className:"bg-popover border-border",children:y.map(s=>e.jsx(H,{value:s,className:"text-foreground focus:bg-accent focus:text-accent-foreground",children:s},s))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(x,{htmlFor:"subject",className:"text-foreground",children:["Subject ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx(g,{id:"subject",placeholder:"What's this about?",value:r.subject,onChange:s=>m("subject",s.target.value),className:"bg-background border-border text-foreground placeholder:text-muted-foreground",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(x,{htmlFor:"message",className:"text-foreground",children:["Message ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx(F,{id:"message",placeholder:"Describe your enquiry in detail...",value:r.message,onChange:s=>m("message",s.target.value),className:"bg-background border-border text-foreground placeholder:text-muted-foreground min-h-[150px] resize-y",required:!0})]}),e.jsx(N,{type:"submit",disabled:t,className:"w-full bg-hive-gold hover:bg-hive-gold-dark text-hive-gold-foreground font-semibold",children:t?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-4 w-4 border-2 border-hive-dark border-t-transparent roun
1ded-full animate-spin"}),"Sending..."]}):e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(A,{className:"h-4 w-4"}),"Send Message"]})})]})})]})})]})]})]})};export{z 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.