Files
authsec_react/src/components/common/Button.jsx
T

32 lines
672 B
React
Raw Normal View History

2026-10-07 09:07:57 +05:30
import React from 'react';
import './common.css';
export function Button({
children,
variant = 'primary',
size = 'md',
isLoading = false,
icon: Icon,
fullWidth = false,
className = '',
disabled,
...props
}) {
return (
<button
className={`btn btn-${variant} btn-${size} ${fullWidth ? 'btn-block' : ''} ${className}`}
disabled={disabled || isLoading}
{...props}
>
{isLoading ? (
<span className="btn-spinner" />
) : (
<>
{Icon && <Icon className="btn-icon" size={size === 'sm' ? 16 : size === 'lg' ? 20 : 18} />}
<span>{children}</span>
</>
)}
</button>
);
}