mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-05-02 11:49:34 +00:00
Initial Commit
This commit is contained in:
commit
f3e2f01bd7
150 changed files with 13612 additions and 0 deletions
41
components/form/form-submit.tsx
Normal file
41
components/form/form-submit.tsx
Normal file
|
@ -0,0 +1,41 @@
|
|||
"Use client";
|
||||
|
||||
import { useFormStatus } from "react-dom";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
interface FormSubmitProps {
|
||||
children: React.ReactNode;
|
||||
disabled?: boolean;
|
||||
className?: string;
|
||||
variant?:
|
||||
| "default"
|
||||
| "destructive"
|
||||
| "outline"
|
||||
| "secondary"
|
||||
| "ghost"
|
||||
| "link"
|
||||
| "primary";
|
||||
}
|
||||
|
||||
export const FormSubmit = ({
|
||||
children,
|
||||
disabled,
|
||||
className,
|
||||
variant = "primary",
|
||||
}: FormSubmitProps) => {
|
||||
const { pending } = useFormStatus();
|
||||
|
||||
return (
|
||||
<Button
|
||||
disabled={pending || disabled}
|
||||
type="submit"
|
||||
variant={variant}
|
||||
size="sm"
|
||||
className={cn(className)}
|
||||
>
|
||||
{children}
|
||||
</Button>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue