diff --git a/src/features/events/components/CreateEventSheet.tsx b/src/features/events/components/CreateEventSheet.tsx index fb007bf..77aca67 100644 --- a/src/features/events/components/CreateEventSheet.tsx +++ b/src/features/events/components/CreateEventSheet.tsx @@ -39,20 +39,42 @@ import { PopoverTrigger, } from "@/components/ui/popover"; import { Calendar } from "@/components/ui/calendar"; +import { Checkbox } from "@/components/ui/checkbox"; import { cn } from "@/lib/utils"; import { toast } from "sonner"; const formSchema = z.object({ - title: z.string().min(2, "Title must be at least 2 characters"), - category: z.string().min(1, "Please select a category"), - date: z.date({ required_error: "Start date is required" }), - endDate: z.date().optional(), - location: z.string().min(2, "Location name is required"), - address: z.string().min(5, "Full address is required"), + name: z.string().min(2, "Name is required"), description: z.string().optional(), - imageUrl: z.string().url("Please enter a valid image URL").optional().or(z.literal("")), - source: z.enum(["official", "community"]).default("official"), - mapUrl: z.string().url().optional().or(z.literal("")), + + startDate: z.date({ required_error: "Start date is required" }), + endDate: z.date().optional(), + startTime: z.string().optional(), + endTime: z.string().optional(), + + allYearEvent: z.boolean().default(false), + + latitude: z.string().optional(), + longitude: z.string().optional(), + pincode: z.string().optional(), + district: z.string().optional(), + state: z.string().optional(), + place: z.string().optional(), // Specific locality/place + + isBookable: z.boolean().default(false), + isEventifyEvent: z.boolean().default(false), + outsideEventUrl: z.string().optional(), + + eventType: z.string().min(1, "Event type is required"), + eventStatus: z.string().default("Pending"), + cancelledReason: z.string().optional(), + + title: z.string().min(2, "Title is required"), // Display title? + importantInformation: z.string().optional(), + + venueName: z.string().optional(), + source: z.string().optional(), + imageUrl: z.string().optional(), }); type FormValues = z.infer; @@ -68,14 +90,28 @@ export function CreateEventSheet({ children }: CreateEventSheetProps) { const form = useForm({ resolver: zodResolver(formSchema), defaultValues: { - title: "", - category: "", - location: "", - address: "", + name: "", description: "", + startTime: "", + endTime: "", + allYearEvent: false, + latitude: "", + longitude: "", + pincode: "", + district: "", + state: "", + place: "", + isBookable: false, + isEventifyEvent: false, + outsideEventUrl: "NA", + eventType: "", + eventStatus: "Pending", + cancelledReason: "NA", + title: "", + importantInformation: "", + venueName: "", + source: "", imageUrl: "", - source: "official", - mapUrl: "", }, }); @@ -97,25 +133,330 @@ export function CreateEventSheet({ children }: CreateEventSheetProps) { {children} - + - Create New Event + Add Event - Add a new event to the platform. Fill in legal details and publishing info. + Fill in the details to create a new event.
- + + + {/* Basic Info */} + ( + + Name + + + + + + )} + /> ( - Event Title + Title - + + + + + )} + /> + + ( + + Description + +