1import{u as F,r as h,j as e,C as g,c as _,N as T,d as j,e as y,f as v,g as f,L as n,h as P,A as M,E as b,s as D}from"./index-DocaPeAE.js";import{I as m}from"./input-CMmhRePw.js";import{T as c}from"./textarea-CxE1gDvj.js";import{C as E}from"./checkbox-DMkc16lN.js";import{S as A,a as I,b as L,c as O,d as B}from"./select-NtMFeCwO.js";import{a as R}from"./auth-logo-DYuEQSsu.js";import{P as U}from"./PageSEO-BKXN4uKe.js";import{o as W,s as i,l as q}from"./types-BHrrR1jH.js";const Y=["UI / UX","Development","Management","Marketing","Content Creation","Career Development","Soft Skills","Mentorship"],H=W({full_name:i().min(2,"Name must be at least 2 characters").max(100),email:i().email("Please enter a valid email"),phone:i().min(10,"Phone number must be at least 10 digits").max(15),job_title:i().min(2,"Job title is required"),organisation:i().min(2,"Organisation is required"),linkedin_url:i().url("Please enter a valid URL"),domain_of_expertise:i().optional(),who_are_your_mentors:i().min(2,"Please share who your mentors are"),why_mentor:i().min(10,"Please share a bit more"),what_mentoring_means:i().min(10,"Please share a bit more"),mentoring_experience:i().min(2,"Please share your experience, even if minimal"),other_skills:i().min(2,"Please share your other skills/areas of expertise"),consent:q(!0,{errorMap:()=>({message:"Please confirm before submitting"})})});function $(){const N=F(),[a,w]=h.useState({full_name:"",email:"",phone:"",job_title:"",organisation:"",linkedin_url:"",domain_of_expertise:"",who_are_your_mentors:"",why_mentor:"",what_mentoring_means:"",mentoring_experience:"",other_skills:"",consent:!1}),[t,x]=h.useState({}),[u,p]=h.useState(!1),[C,k]=h.useState(!1),r=(s,l)=>{w(o=>({...o,[s]:l})),t[s]&&x(o=>({...o,[s]:void 0}))},S=async()=>{const s=H.safeParse(a);if(!s.success){const l={};s.error.errors.forEach(o=>{const d=o.path[0];l[d]=o.message}),x(l),b.error("Please fill in all required fields");return}p(!0);try{const{consent:l,...o}=s.data,{error:d}=await D.from("mentor_applicants").insert({...o,domain_of_expertise:o.domain_of_expertise||null});if(d)throw d;k(!0)}catch(l){b.error(l.message||"Something went wrong. Please try again.")}finally{p(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(U,{title:"Become a Mentor - Teedians Community",description:"Share your expertise and mentorship with the Teedians community. Apply to become a Community Mentor."}),e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx("header",{className:"border-b border-border bg-card",children:e.jsx("div",{className:"container mx-auto px-4 py-6",children:e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Teedians Community Hub"})})}),e.jsx("section",{className:"flex-1 py-12 px-4",children:e.jsx("div",{className:"container mx-auto max-w-lg",children:C?e.jsxs(g,{children:[e.jsxs(_,{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-primary/10",children:e.jsx(T,{className:"h-7 w-7 text-primary"})}),e.jsx(j,{className:"text-2xl",children:"Application received!"}),e.jsx(y,{children:"Thank you for offering to give back as a mentor. Our team will review your application and get back to you by email."})]}),e.jsx(v,{children:e.jsx(f,{className:"w-full",variant:"outline",onClick:()=>N("/auth"),children:"Already have an account? Sign in"})})]}):e.jsxs(g,{children:[e.jsxs(_,{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("img",{src:R,alt:"TD Community",className:"h-14 w-14 object-contain"})}),e.jsx(j,{className:"text-2xl",children:"Become a Mentor"}),e.jsxs(y,{children:["It's our pleasure to onboard you as our Community Mentors, to share your mentorship with Tamil Nadu's ",e.jsx("strong",{children:"Top 10% of college students"}),"."]})]}),e.jsxs(v,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"full_name",children:"Full Name"}),e.jsx(m,{id:"full_name",value:a.full_name,onChange:s=>r("full_name",s.target.value),placeholder:"Enter your full name"}),t.full_name&&e.jsx("p",{className:"text-sm text-destructive",children:t.full_name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"email",children:"Email Address"}),e.jsx(m,{id:"email",type:"email",value:a.email,onChange:s=>r("email",s.target.value),placeholder:"[email protected]"}),t.email&&e.jsx("p",{className:"text-sm text-destructive",children:t.email})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"phone",children:"Phone Number"}
1),e.jsx(m,{id:"phone",type:"tel",value:a.phone,onChange:s=>r("phone",s.target.value),placeholder:"Enter your phone number"}),t.phone&&e.jsx("p",{className:"text-sm text-destructive",children:t.phone})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"job_title",children:"Current Job Title"}),e.jsx(m,{id:"job_title",value:a.job_title,onChange:s=>r("job_title",s.target.value),placeholder:"e.g. Product Designer"}),t.job_title&&e.jsx("p",{className:"text-sm text-destructive",children:t.job_title})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"organisation",children:"Current Organisation"}),e.jsx(m,{id:"organisation",value:a.organisation,onChange:s=>r("organisation",s.target.value),placeholder:"Where do you currently work?"}),t.organisation&&e.jsx("p",{className:"text-sm text-destructive",children:t.organisation})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"linkedin_url",children:"Your LinkedIn Profile URL"}),e.jsx(m,{id:"linkedin_url",value:a.linkedin_url,onChange:s=>r("linkedin_url",s.target.value),placeholder:"https://linkedin.com/in/..."}),t.linkedin_url&&e.jsx("p",{className:"text-sm text-destructive",children:t.linkedin_url})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"domain_of_expertise",children:"Domain of Expertise (optional)"}),e.jsxs(A,{value:a.domain_of_expertise,onValueChange:s=>r("domain_of_expertise",s),children:[e.jsx(I,{id:"domain_of_expertise",children:e.jsx(L,{placeholder:"Select a domain"})}),e.jsx(O,{children:Y.map(s=>e.jsx(B,{value:s,children:s},s))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"who_are_your_mentors",children:"Who is/are your mentor(s)?"}),e.jsx(c,{id:"who_are_your_mentors",value:a.who_are_your_mentors,onChange:s=>r("who_are_your_mentors",s.target.value),rows:2}),t.who_are_your_mentors&&e.jsx("p",{className:"text-sm text-destructive",children:t.who_are_your_mentors})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"why_mentor",children:"Why Mentor at Think Digital?"}),e.jsx(c,{id:"why_mentor",value:a.why_mentor,onChange:s=>r("why_mentor",s.target.value),rows:3}),t.why_mentor&&e.jsx("p",{className:"text-sm text-destructive",children:t.why_mentor})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"what_mentoring_means",children:"What does Mentoring mean to you?"}),e.jsx(c,{id:"what_mentoring_means",value:a.what_mentoring_means,onChange:s=>r("what_mentoring_means",s.target.value),rows:3}),t.what_mentoring_means&&e.jsx("p",{className:"text-sm text-destructive",children:t.what_mentoring_means})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"mentoring_experience",children:"Your experience in mentoring so far?"}),e.jsx(c,{id:"mentoring_experience",value:a.mentoring_experience,onChange:s=>r("mentoring_experience",s.target.value),rows:3}),t.mentoring_experience&&e.jsx("p",{className:"text-sm text-destructive",children:t.mentoring_experience})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"other_skills",children:"Other Skills or Areas of Expertise you can Mentor"}),e.jsx(c,{id:"other_skills",value:a.other_skills,onChange:s=>r("other_skills",s.target.value),rows:2}),t.other_skills&&e.jsx("p",{className:"text-sm text-destructive",children:t.other_skills})]}),e.jsxs("div",{className:"flex items-start gap-2 pt-2",children:[e.jsx(E,{id:"consent",checked:a.consent,onCheckedChange:s=>r("consent",s===!0),className:"mt-0.5"}),e.jsx(n,{htmlFor:"consent",className:"text-sm font-normal leading-snug",children:"I'm willing to give back as a Mentor at Think Digital, and the information given above is correct."})]}),t.consent&&e.jsx("p",{className:"text-sm text-destructive",children:t.consent}),e.jsx(f,{className:"w-full",onClick:S,disabled:u,children:u?e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"mr-2 h-4 w-4 animate-spin"})," Submitting..."]}):e.jsxs(e.Fragment,{children:["Give Back to the Future ",e.jsx(M,{className:"ml-2 h-4 w-4"})]})})]})]})})}),e.jsx("footer",{className:"border-t border-border bg-card py-8 mt-auto",children:e.jsx("div",{className:"container mx-auto px-4 text-center text-muted-foreground",children:e.jsxs("p",{children:["© ",new Date().getFullYear()," Teedians Community. All rights reserved."]})})})]})]})}export{$ as default}; 2//# sourceMappingURL=ApplyMentor-BYXTkyJf.js.map
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.