ten / playground /src /components /Button /LoadingButton.tsx
3v324v23's picture
Зафиксирована рабочая версия TEN-Agent для HuggingFace Space
87337b1
raw
history blame contribute delete
544 Bytes
import { Button, ButtonProps } from "@/components/ui/button"
import { AnimatedSpinnerIcon } from "@/components/Icon"
export interface LoadingButtonProps extends Omit<ButtonProps, "asChild"> {
loading?: boolean
svgProps?: React.SVGProps<SVGSVGElement>
}
export function LoadingButton(props: LoadingButtonProps) {
const { loading, disabled, children, svgProps, ...rest } = props
return (
<Button {...rest} disabled={loading || disabled}>
{loading && <AnimatedSpinnerIcon {...svgProps} />}
{children}
</Button>
)
}