MCPcopy Create free account
hub / github.com/bytebase/bytebase / EnvironmentLabel

Function EnvironmentLabel

frontend/src/react/components/EnvironmentLabel.tsx:86–108  ·  view source on GitHub ↗
({
  environment: envProp,
  environmentName,
  className,
}: {
  environment?: Environment;
  environmentName?: string;
  className?: string;
})

Source from the content-addressed store, hash-verified

84 * For high-row use, prefer `EnvironmentBadge` directly with hoisted data.
85 */
86export 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}

Callers

nothing calls this directly

Calls 2

useEnvironmentFunction · 0.90
usePlanFeatureFunction · 0.90

Tested by

no test coverage detected