Add module event producer coverage
Some checks failed
Dependency Audit / dependency-audit (push) Has been cancelled
Module Matrix / module-matrix (push) Has been cancelled

This commit is contained in:
2026-07-10 18:40:38 +02:00
parent 83784ea19d
commit c61abe154c
10 changed files with 332 additions and 26 deletions

View File

@@ -0,0 +1,32 @@
import type { ReactNode } from "react";
import type { PolicySourcePathItem } from "./PolicySourcePath";
export type PolicyPathHelpProps = {
lines: ReactNode[];
className?: string;
lineClassName?: string;
};
export type NormalizedPolicySourcePathItem = {
label: string;
policy?: unknown;
};
export default function PolicyPathHelp({ lines, className = "", lineClassName = "" }: PolicyPathHelpProps) {
return (
<span className={["policy-path-help", className].filter(Boolean).join(" ")}>
{lines.map((line, index) =>
<span className={["policy-path-help-line", lineClassName].filter(Boolean).join(" ")} key={`${String(line)}-${index}`}>
{line}
</span>
)}
</span>);
}
export function normalizePolicySourcePathItems(items: PolicySourcePathItem[]): NormalizedPolicySourcePathItem[] {
return items.map((item) => {
if (typeof item === "string") return { label: item };
return { label: item.label, policy: item.policy };
}).filter((item) => item.label.trim());
}