feat: code split module buttons

This commit is contained in:
TrèsAbhi committed 2024-02-12 19:24:34 -06:00
1 parent 9d7c60e92d
commit 574b1eec92
17 files changed
+230 -153

No files matched your search

@@ -0,0 +1,33 @@
import { HTMLAttributes } from 'react';
import {
TankComponentButton,
TankComponentButtonProps,
} from './TankComponentButton';
interface GenericTankComponentButtonProps extends TankComponentButtonProps {
icon: string;
iconStyles?: HTMLAttributes<HTMLImageElement>['style'];
}
export function GenericTankComponentButton({
icon,
iconStyles,
...props
}: GenericTankComponentButtonProps) {
return (
<TankComponentButton disabled={props.disabled} {...props}>
<img
draggable={false}
src={icon}
style={{
width: 32,
height: 32,
position: 'absolute',
opacity: props.disabled ? 0.5 : 1,
transform: 'scale(0.75)',
...iconStyles,
}}
/>
</TankComponentButton>
);
}