All checks were successful
Vercel Production Deployment / Deploy-Production (push) Successful in 1m31s
13 lines
337 B
TypeScript
13 lines
337 B
TypeScript
import { useFormStatus } from "react-dom";
|
|
import { Button } from "~/components/ui/button";
|
|
|
|
export default function SubmitButton(props: { text: string }) {
|
|
const { text } = props;
|
|
const { pending } = useFormStatus();
|
|
return (
|
|
<Button disabled={pending}>
|
|
{pending ? `Adding ${text}` : `Add ${text}`}
|
|
</Button>
|
|
);
|
|
}
|