Add possibility to exclude margin in spool icon for overview sites

This commit is contained in:
Panagiotis Doulgeris
2024-12-22 15:38:05 +01:00
parent fd256bab95
commit 6b2dbda354
4 changed files with 13 additions and 5 deletions

View File

@@ -3,13 +3,15 @@ import "./spoolIcon.css";
interface Props {
color: string | { colors: string[]; vertical: boolean };
size?: "small" | "large";
no_margin? : boolean
}
export default function SpoolIcon(props: Props) {
export default function SpoolIcon(props: Readonly<Props>) {
let dirClass = "vertical";
let cols = [];
let size = props.size ? props.size : "small";
let no_margin = props.no_margin ? "no-margin" : "";
if (typeof props.color === "string") {
cols = [props.color];
} else {
@@ -18,7 +20,7 @@ export default function SpoolIcon(props: Props) {
}
return (
<div className={"spool-icon " + dirClass + " " + size}>
<div className={"spool-icon " + dirClass + " " + size + " " + no_margin}>
{cols.map((col) => (
<div
key={col}