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 ( {lines.map((line, index) => {line} )} ); } 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()); }