first commit
This commit is contained in:
commit
5d6023a8af
52 files changed
+5830
No files matched your search
@@ -0,0 +1,29 @@
|
||||
"use client";
|
||||
|
||||
import { JSX } from "react";
|
||||
import { useFormStatus } from "react-dom";
|
||||
|
||||
export default function SubmitButton({
|
||||
label = "Add User",
|
||||
}: {
|
||||
label?: string;
|
||||
}): JSX.Element {
|
||||
const { pending } = useFormStatus();
|
||||
|
||||
return (
|
||||
<button
|
||||
type="submit"
|
||||
disabled={pending}
|
||||
className="btn btn-primary w-full md:w-auto"
|
||||
>
|
||||
{pending ? (
|
||||
<>
|
||||
<span className="loading loading-spinner loading-xs"></span>
|
||||
Saving...
|
||||
</>
|
||||
) : (
|
||||
label
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user