(binding: string)
| 299 | |
| 300 | // Label for a selected binding chip — uses cache to survive search changes |
| 301 | const chipLabel = (binding: string): string => { |
| 302 | if (binding === ALL_USERS_USER_EMAIL) { |
| 303 | return t("settings.members.all-users"); |
| 304 | } |
| 305 | const cached = labelCacheRef.current.get(binding); |
| 306 | if (cached) return cached; |
| 307 | const fullname = bindingToFullname(binding); |
| 308 | if (fullname.startsWith("serviceAccounts/")) |
| 309 | return fullname.slice("serviceAccounts/".length); |
| 310 | if (fullname.startsWith("workloadIdentities/")) |
| 311 | return fullname.slice("workloadIdentities/".length); |
| 312 | return resolveLabel(fullname) || binding; |
| 313 | }; |
| 314 | |
| 315 | return ( |
| 316 | <div ref={containerRef} className="relative"> |
no test coverage detected