"use client" import { useActionState, useState } from "react" import { submitAct } from "@/app/actions" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Textarea } from "@/components/ui/textarea" import { Label } from "@/components/ui/label" import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Loader2, Send, Sparkles } from "lucide-react" import { toast } from "sonner" const categories = [ { value: "Community", label: "Community Support", color: "bg-blue-500" }, { value: "Environment", label: "Environmental Care", color: "bg-green-500" }, { value: "Education", label: "Teaching & Learning", color: "bg-yellow-500" }, { value: "Health", label: "Health & Wellness", color: "bg-red-500" }, { value: "Other", label: "Other Kindness", color: "bg-purple-500" }, ] export function SubmissionForm() { const [state, formAction, isPending] = useActionState(submitAct, null) const [activeCategory, setActiveCategory] = useState("") if (state?.success) { toast.success("Your act has been released into the stream!") // Reset form state logic would go here, but for now we show a success card return (

Released to the Stream!

Your act of kindness is now flowing through the community. Watch as others allocate value to it.

) } return (
{/* Decorational glow */}

Submit Kindness

Share what you've done. Let the community value it.

{state?.errors?.title &&

{state.errors.title}

}
{state?.errors?.category &&

{state.errors.category}

}
{state?.errors?.impact &&

{state.errors.impact}

}