"use client"; import { useFormStatus } from "react-dom"; import Image from "next/image"; import { SearchIcon } from "@repo/ui/icons"; import { createCanvas } from "@/app/actions/doers"; import { toast } from "sonner"; export default function SearchandCreate() { return (
{ const res = await createCanvas(); if (!res.success) { toast.warning(res.message, { style: { backgroundColor: "rgb(22 31 42 / 0.3)" }, }); } }} >
); } function Button() { const { pending } = useFormStatus(); return ( ); }