| 117 | // row); everything else gets a dot. User policies are filled, plugin |
| 118 | // defaults are hollow rings. |
| 119 | const indicatorFor = (policy: EffectivePolicy) => { |
| 120 | if (policy.source === "plugin-default" && policy.action === "approve") { |
| 121 | return null; |
| 122 | } |
| 123 | const colors = POLICY_INDICATOR_COLOR[policy.action]; |
| 124 | const stateLabel = POLICY_STATE_LABEL[policy.action]; |
| 125 | const filled = policy.source === "user"; |
| 126 | const label = |
| 127 | policy.source === "user" |
| 128 | ? `${stateLabel} (matched ${policy.pattern})` |
| 129 | : `Plugin default: ${stateLabel}`; |
| 130 | return { |
| 131 | label, |
| 132 | className: filled ? colors.dot : cn("bg-transparent ring-1", colors.ring), |
| 133 | }; |
| 134 | }; |
| 135 | |
| 136 | type TreeNode = { |
| 137 | segment: string; |