Files
blitzkit/src/components/ModuleButtons/GenericTankComponentButton.tsx
T

46 lines
1019 B
TypeScript
Raw Normal View History

2024-02-12 19:24:34 -06:00
import { HTMLAttributes } from 'react';
import {
TankComponentButton,
TankComponentButtonProps,
} from './TankComponentButton';
interface GenericTankComponentButtonProps extends TankComponentButtonProps {
icon: string;
iconStyles?: HTMLAttributes<HTMLImageElement>['style'];
}
export function GenericTankComponentButton({
icon,
iconStyles,
2024-02-13 09:40:00 -06:00
children,
2024-02-12 19:24:34 -06:00
...props
}: GenericTankComponentButtonProps) {
return (
2024-02-13 09:40:00 -06:00
<TankComponentButton {...props}>
<div
2024-02-12 19:24:34 -06:00
style={{
2024-02-13 09:40:00 -06:00
width: 48,
height: 40,
position: 'relative',
2024-02-12 19:24:34 -06:00
}}
2024-02-13 09:40:00 -06:00
>
<img
draggable={false}
src={icon}
style={{
width: 32,
height: 32,
position: 'absolute',
opacity: props.disabled ? 0.5 : 1,
transform: 'translate(-50%, -50%) scale(0.75)',
top: '50%',
left: '50%',
...iconStyles,
}}
/>
</div>
{children}
2024-02-12 19:24:34 -06:00
</TankComponentButton>
);
}