diff options
| author | Sebastien Castiel <sebastien@castiel.me> | 2023-12-06 15:08:52 -0500 |
|---|---|---|
| committer | Sebastien Castiel <sebastien@castiel.me> | 2023-12-06 15:08:52 -0500 |
| commit | 570aa713b1b2becf7c06c89610c75d2cb119b532 (patch) | |
| tree | b6e3ae339bd55a7a00d77ee64532ece9fc43c13f /src/components/submit-button.tsx | |
| parent | fee1963284eafa6db7887103a156799b7610e13d (diff) | |
Delete expense
Diffstat (limited to 'src/components/submit-button.tsx')
| -rw-r--r-- | src/components/submit-button.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/components/submit-button.tsx b/src/components/submit-button.tsx index 7489c6c..c5215c5 100644 --- a/src/components/submit-button.tsx +++ b/src/components/submit-button.tsx @@ -1,16 +1,16 @@ -import { Button } from '@/components/ui/button' +import { Button, ButtonProps } from '@/components/ui/button' import { Loader2 } from 'lucide-react' -import { PropsWithChildren, ReactNode } from 'react' +import { ReactNode } from 'react' import { useFormState } from 'react-hook-form' -type Props = PropsWithChildren<{ +type Props = { loadingContent: ReactNode -}> +} & ButtonProps -export function SubmitButton({ children, loadingContent }: Props) { +export function SubmitButton({ children, loadingContent, ...props }: Props) { const { isSubmitting } = useFormState() return ( - <Button type="submit" disabled={isSubmitting}> + <Button type="submit" disabled={isSubmitting} {...props}> {isSubmitting ? ( <> <Loader2 className="w-4 h-4 mr-2 animate-spin" /> {loadingContent} |
