Files
blitzkit/packages/website/src/components/SmallTankIcon.tsx
T

30 lines
608 B
TypeScript
Raw Normal View History

2026-08-06 20:01:50 -05:00
import { alias } from "@blitzkit/core";
2024-01-12 20:42:10 -06:00
interface SmallTankIconProps {
id: number;
size?: number;
}
const WIDTH = 70;
const HEIGHT = 24;
export function SmallTankIcon({ id, size = HEIGHT }: SmallTankIconProps) {
return (
<div
style={{
height: size,
2026-08-04 19:54:08 -05:00
overflow: "hidden",
2024-01-12 20:42:10 -06:00
width: WIDTH * (size / HEIGHT),
}}
>
<img
2024-05-04 16:28:12 -05:00
alt={`Tank ${id}`}
2026-08-06 20:01:50 -05:00
src={alias("api", `/tanks/${id}/icons/small.webp`)}
2024-01-12 20:42:10 -06:00
style={{
transform: `scale(${(size / HEIGHT) * 100}%)`,
2026-08-04 19:54:08 -05:00
transformOrigin: "top left",
2024-01-12 20:42:10 -06:00
}}
/>
</div>
);
}