feat(tasks): allow management of job intervals and disabling them (#3408)

This commit is contained in:
Meier Lukas
2025-07-03 20:59:26 +02:00
committed by GitHub
parent 95c8aadb0c
commit 9398dd983c
37 changed files with 5224 additions and 195 deletions

View File

@@ -0,0 +1,27 @@
import type { IconNode } from "@tabler/icons-react";
import { createReactComponent } from "@tabler/icons-react";
import { parseSync } from "svgson";
import { capitalize } from "@homarr/common";
interface CustomIconOptions {
name: string;
svgContent: string;
type: "outline" | "filled";
}
export const createCustomIcon = ({ svgContent, type, name }: CustomIconOptions) => {
const icon = parseSync(svgContent);
const children = icon.children.map(({ name, attributes }, i) => {
attributes.key = `svg-${i}`;
attributes.strokeWidth = attributes["stroke-width"] ?? "2";
delete attributes["stroke-width"];
return [name, attributes] satisfies IconNode[number];
});
const pascalCaseName = `Icon${capitalize(name.replace("-", ""))}`;
return createReactComponent(type, name, pascalCaseName, children);
};