mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
fix: remove loadingText prop
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import { Slot } from '@radix-ui/react-slot';
|
||||
import { VariantProps, cva } from 'class-variance-authority';
|
||||
import type { VariantProps } from 'class-variance-authority';
|
||||
import { cva } from 'class-variance-authority';
|
||||
import { Loader } from 'lucide-react';
|
||||
|
||||
import { cn } from '../lib/utils';
|
||||
@ -53,15 +54,10 @@ export interface ButtonProps
|
||||
* Will display the loading spinner and disable the button.
|
||||
*/
|
||||
loading?: boolean;
|
||||
|
||||
/**
|
||||
* The label to show in the button when `isLoading` is true
|
||||
*/
|
||||
loadingText?: string;
|
||||
}
|
||||
|
||||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
({ className, variant, size, asChild = false, loadingText, loading, ...props }, ref) => {
|
||||
({ className, variant, size, asChild = false, loading, ...props }, ref) => {
|
||||
if (asChild) {
|
||||
return (
|
||||
<Slot className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
|
||||
@ -79,7 +75,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
disabled={isDisabled}
|
||||
>
|
||||
{isLoading && <Loader className={cn('mr-2 animate-spin', loaderVariants({ size }))} />}
|
||||
{isLoading && loadingText ? loadingText : props.children}
|
||||
{props.children}
|
||||
</button>
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user