- {Object.entries(rule.match).map(([key, value], j) => (
-
- {key}:
-
- {value as string}
-
-
- ))}
+ {Object.entries(rule.match || {}).map(([key, value], j) => {
+ // Format the value into a readable string
+ let displayValue = value;
+ if (typeof value === 'object' && value !== null) {
+ // Handle nested objects by getting all key-value pairs
+ const formatNestedObject = (obj: any, parentKey?: string): string => {
+ const entries = Object.entries(obj);
+ if (entries.length === 0) return '';
+
+ const [k, v] = entries[0];
+ if (typeof v === 'object' && v !== null) {
+ return formatNestedObject(v, k);
+ }
+ return `${parentKey ? `${parentKey} ` : ''}${k} ${v}`;
+ };
+ displayValue = formatNestedObject(value);
+ }
+ return (
+
+ {key}:
+
+ {String(displayValue)}
+
+
+ );
+ })}