mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-23 07:34:07 -05:00
29 lines
789 B
TypeScript
29 lines
789 B
TypeScript
import englishToInteral from "lib/englishToInternal.json";
|
|
import { useTranslation } from "lib/useMockT";
|
|
import React from "react";
|
|
|
|
interface GearImageProps {
|
|
englishName: string;
|
|
mini?: boolean;
|
|
}
|
|
|
|
const GearImage: React.FC<GearImageProps> = ({ englishName, mini }) => {
|
|
const { t } = useTranslation();
|
|
const wh = "32px";
|
|
|
|
const key = englishName as keyof typeof englishToInteral;
|
|
const gearInternal = englishToInteral[key];
|
|
return (
|
|
<img
|
|
alt={t(`game;${englishName}`)}
|
|
src={`https://raw.githubusercontent.com/Leanny/leanny.github.io/master/splat2/gear/${gearInternal}.png`}
|
|
title={t(`game;${englishName}`)}
|
|
style={
|
|
mini ? { width: wh, height: wh, display: "inline-block" } : undefined
|
|
}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default GearImage;
|