mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 00:31:13 -05:00
Refactor code structure and remove redundant changes
This commit is contained in:
28
src-old/components/ui/icon-button.tsx
Normal file
28
src-old/components/ui/icon-button.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user