import { zodResolver } from '@hookform/resolvers/zod' import { SupaSquadApplication, supaSquadApplicationSchema, } from '~/data/open-source/contributing/supasquad.utils' import { AlertCircle } from 'lucide-react' import { FC, memo, useEffect, useState } from 'react' import { useForm } from 'react-hook-form' import { Button, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Input, Separator, TextArea, } from 'ui' import { MultiSelector, MultiSelectorContent, MultiSelectorItem, MultiSelectorList, MultiSelectorTrigger, } from 'ui-patterns/multi-select' import { Alert, AlertDescription } from 'ui/src/components/shadcn/ui/alert' import { AlertDialog, AlertDialogAction, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from 'ui/src/components/shadcn/ui/alert-dialog' import { CountrySelector } from '../Supasquad/CountrySelector' interface FormItem { type: 'text' | 'textarea' label: string placeholder: string required: boolean className?: string component: typeof TextArea | typeof Input } interface Track { heading: string description: string } interface Props { className?: string title?: string description?: string } const tracks: Track[] = [ { heading: 'Advocate', description: 'Help spread word on socials answer community questions', }, { heading: 'Helper', description: 'Answer questions and improve docs across our platforms', }, { heading: 'Builder/Maintainer', description: 'Contribute to client libraries, manage issues, fix bugs', }, { heading: 'Moderator', description: 'Ensure our social spaces remain productive and helpful', }, ] const productAreasOfInterest: string[] = [ 'Auth', 'AI Builders', 'Branching', 'Client libraries', 'Database / Postgres', 'Dashboard', 'CLI', 'Edge Functions', 'Integrations', 'Realtime', 'Storage', 'Vectors / AI', 'Other', ] const languagesSpoken: string[] = [ 'English', 'Spanish', 'Portuguese', 'French', 'German', 'Italian', 'Russian', 'Arabic', 'Hindi', 'Mandarin Chinese', 'Japanese', 'Turkish', 'Indonesian', 'Thai', 'Vietnamese', 'Bengali', 'Urdu', 'Polish', 'Dutch', 'Other', ] const FormContent = memo(function FormContent({ form, errors, onSubmit, honeypot, setHoneypot, isMobile, isSubmitted, handleCancel, isSubmitting, }: { form: ReturnType> errors: { [key: string]: string } onSubmit: (data: SupaSquadApplication) => Promise honeypot: string setHoneypot: React.Dispatch> isMobile: boolean isSubmitted: boolean handleCancel: () => void isSubmitting: boolean }) { return (
( First Name * )} /> ( Last Name *
)} />
( Email Address *
)} />

Interests and skills

( What track would you like to be considered for? * See longer descriptions of the 4 options above
{ // Convert selected headings back to track objects const selectedTracks = values.map( (heading) => tracks.find((track) => track.heading === heading)! ) field.onChange(selectedTracks) }} values={field.value.map((track) => track.heading)} size="small" > {tracks.map((item) => (
{item.heading}
{item.description}
))}
)} /> ( Why do you want to join the program? * What do you have to contribute? What would you like to get out of it?