mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Use storybook to display public components. #9914 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -65,24 +65,14 @@ Button.displayName = 'Button';
|
||||
|
||||
export const ButtonLoading = React.forwardRef<
|
||||
HTMLButtonElement,
|
||||
ButtonProps & { loading?: boolean }
|
||||
Omit<ButtonProps, 'asChild'> & { loading?: boolean }
|
||||
>(
|
||||
(
|
||||
{
|
||||
className,
|
||||
variant,
|
||||
size,
|
||||
asChild = false,
|
||||
children,
|
||||
loading = false,
|
||||
disabled,
|
||||
...props
|
||||
},
|
||||
{ className, variant, size, children, loading = false, disabled, ...props },
|
||||
ref,
|
||||
) => {
|
||||
const Comp = asChild ? Slot : 'button';
|
||||
return (
|
||||
<Comp
|
||||
<Button
|
||||
className={cn(buttonVariants({ variant, size, className }))}
|
||||
ref={ref}
|
||||
{...props}
|
||||
@ -90,7 +80,7 @@ export const ButtonLoading = React.forwardRef<
|
||||
>
|
||||
{loading && <Loader2 className="animate-spin" />}
|
||||
{children}
|
||||
</Comp>
|
||||
</Button>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user