({
environment: envProp,
environmentName,
className,
}: {
environment?: Environment;
environmentName?: string;
className?: string;
})
| 84 | * For high-row use, prefer `EnvironmentBadge` directly with hoisted data. |
| 85 | */ |
| 86 | export function EnvironmentLabel({ |
| 87 | environment: envProp, |
| 88 | environmentName, |
| 89 | className, |
| 90 | }: { |
| 91 | environment?: Environment; |
| 92 | environmentName?: string; |
| 93 | className?: string; |
| 94 | }) { |
| 95 | // Always called (rules of hooks); result ignored when envProp is provided. |
| 96 | const envFromStore = useEnvironment(environmentName || NULL_ENVIRONMENT_NAME); |
| 97 | const environment = envProp ?? envFromStore; |
| 98 | const hasEnvTierFeature = usePlanFeature( |
| 99 | PlanFeature.FEATURE_ENVIRONMENT_TIERS |
| 100 | ); |
| 101 | return ( |
| 102 | <EnvironmentBadge |
| 103 | environment={environment} |
| 104 | hasEnvTierFeature={hasEnvTierFeature} |
| 105 | className={className} |
| 106 | /> |
| 107 | ); |
| 108 | } |
nothing calls this directly
no test coverage detected