"use client"; import { useActionState } from "react"; import { createOffer } from "@/lib/actions/offers"; 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 { ImageUploader } from "@/components/shared/image-uploader"; export function OfferForm({ needId }: { needId: string }) { const [state, action, pending] = useActionState(createOffer, undefined); return (
{state?.errors?.title && (

{state.errors.title[0]}

)}