@@ -17,13 +17,6 @@ import {
1717 FormMessage ,
1818} from "@/components/ui/form" ;
1919import { Input } from "@/components/ui/input" ;
20- import {
21- Select ,
22- SelectContent ,
23- SelectItem ,
24- SelectTrigger ,
25- SelectValue ,
26- } from "@/components/ui/select" ;
2720import { Checkbox } from "@/components/ui/checkbox" ;
2821import { Textarea } from "@/components/ui/textarea" ;
2922import { Card , CardContent , CardHeader , CardTitle } from "@/components/ui/card" ;
@@ -67,21 +60,7 @@ const sponsorshipTiers = [
6760 } ,
6861] ;
6962
70- const formSchema = z . object ( {
71- fullName : z . string ( ) . min ( 2 , {
72- message : "Full name must be at least 2 characters." ,
73- } ) ,
74- email : z . string ( ) . email ( {
75- message : "Please enter a valid email address." ,
76- } ) ,
77- companyName : z . string ( ) . optional ( ) ,
78- sponsorshipTier : z . array ( z . string ( ) ) . refine ( ( value ) => value . some ( ( item ) => item ) , {
79- message : "You have to select at least one item." ,
80- } ) ,
81- message : z . string ( ) . optional ( ) ,
82- honeypot : z . string ( ) . optional ( ) , // Honeypot field
83- "cf-turnstile-response" : z . string ( ) . min ( 1 , { message : "Please complete the CAPTCHA." } ) ,
84- } ) ;
63+ import { formSchema } from "@/lib/sponsorship-schema" ;
8564
8665export default function SponsorshipsPage ( ) {
8766 const [ isSuccess , setIsSuccess ] = useState ( false ) ;
@@ -254,10 +233,10 @@ export default function SponsorshipsPage() {
254233 return checked
255234 ? field . onChange ( [ ...field . value , item . value ] )
256235 : field . onChange (
257- field . value ?. filter (
258- ( value ) => value !== item . value ,
259- ) ,
260- ) ;
236+ field . value ?. filter (
237+ ( value : string ) => value !== item . value ,
238+ ) ,
239+ ) ;
261240 } }
262241 />
263242 </ FormControl >
0 commit comments