New spool color indication that supports multi colors

This commit is contained in:
Donkie
2024-06-09 19:23:43 +02:00
parent 30098e0213
commit e2df888e96
6 changed files with 46 additions and 14 deletions

View File

@@ -1,15 +1,18 @@
import Icon from "@ant-design/icons";
import SpoolSVG from "../icon_spool.svg?react";
import "./spoolIcon.css";
export default function SpoolIcon(props: { color: string | string[] }) {
const cols = Array.isArray(props.color) ? props.color : [props.color];
export default function SpoolIcon(props: { color: string }) {
return (
<Icon
component={SpoolSVG}
style={{
color: "#" + props.color,
fontSize: 42,
marginRight: 0,
}}
/>
<div className="spool-icon">
{cols.map((col) => (
<div
key={col}
style={{
backgroundColor: "#" + col.replace("#", ""),
}}
></div>
))}
</div>
);
}