рефакторинг
This commit is contained in:
@@ -29,18 +29,3 @@ export const Button: React.FC<IButtonProps> = ({
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
export interface IIconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
icon: IconName;
|
||||
danger?: boolean;
|
||||
label: string;
|
||||
}
|
||||
|
||||
export const IconButton: React.FC<IIconButtonProps> = ({ icon, danger, label, className, ...rest }) => {
|
||||
const classes = [styles.iconButton, danger ? styles.danger : '', className].filter(Boolean).join(' ');
|
||||
return (
|
||||
<button type="button" className={classes} aria-label={label} title={label} {...rest}>
|
||||
<Icon name={icon} size="sm" />
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user