import * as React from "react"; import {Slot} from "@radix-ui/react-slot"; import {cn} from "@eloquent/styles"; import { ButtonProps } from "./Button.props"; import { buttonVariants } from "./variants"; import { Loader2 } from "lucide-react"; export const Button = React.forwardRef( function EloquentButton({ className, variant = "default", disabled = false, loading = false, size = "default", asChild = false, children, labelLoading = "Carregando...", ...props }, ref) { const Comp = asChild ? Slot : "button"; const LoadingContent = (
{size !== "icon" && labelLoading}
) return ( {loading ? LoadingContent : children} ); } );