phantasmal-world/src/ui/SectionIdIcon.tsx
2019-07-02 17:00:24 +02:00

25 lines
573 B
TypeScript

import React from "react";
import { SectionId } from "../domain";
export function SectionIdIcon({
section_id,
size = 28,
title
}: {
section_id: SectionId,
size?: number,
title?: string
}) {
return (
<div
title={title}
style={{
display: 'inline-block',
width: size,
height: size,
backgroundImage: `url(${process.env.PUBLIC_URL}/images/sectionids/${SectionId[section_id]}.png)`,
backgroundSize: size
}}
/>
);
}