import React from 'react';
import {Button} from "@/components/ui/button";
import {Spinner} from "@/components/ui/spinner";
interface Props {
    loading?: boolean;
    text?: string|React.ReactNode;
    loadingText?: string;
    type?: "button" | "submit" | "reset";
    classNames?: string;
}
function PrimaryButton({loading, text = 'Sign In', loadingText = 'Signing In', type, classNames}: Props) {
    return (
        <Button
            type={type ?? 'button'}
            className={`bg-blue-700 text-white hover:bg-blue-800 focus:ring-2 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center cursor-pointer ${classNames}`}
        >
            {loading ? (
                <span className="inline-flex items-center">
                  <Spinner className="" />
                    <span className="ml-2">{loadingText}...</span>
                </span>
            ) : (
                <span>{text}</span>
            )}
        </Button>
    );
}

export default PrimaryButton;