mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 18:31:13 -05:00
29 lines
532 B
TypeScript
29 lines
532 B
TypeScript
import { Button, ButtonProps } from './button';
|
|
|
|
interface IconButtonProps extends Omit<ButtonProps, 'loading'> {
|
|
icon: React.ReactNode;
|
|
label: string; // For accessibility
|
|
isLoading?: boolean;
|
|
}
|
|
|
|
export const IconButton = ({
|
|
icon,
|
|
label,
|
|
isLoading = false,
|
|
variant = 'ghost',
|
|
size = 'icon',
|
|
...props
|
|
}: IconButtonProps) => {
|
|
return (
|
|
<Button
|
|
variant={variant}
|
|
size={size}
|
|
loading={isLoading}
|
|
aria-label={label}
|
|
{...props}
|
|
>
|
|
{!isLoading && icon}
|
|
</Button>
|
|
);
|
|
};
|