diff --git a/features/admin.feature-gate.v1/components/feature-flag-label.tsx b/features/admin.feature-gate.v1/components/feature-flag-label.tsx index baad6c07895..23ce95e20b2 100644 --- a/features/admin.feature-gate.v1/components/feature-flag-label.tsx +++ b/features/admin.feature-gate.v1/components/feature-flag-label.tsx @@ -31,24 +31,28 @@ interface FeatureFlagLabelPropsInterface { featureConfig?: FeatureAccessConfigInterface; featureName?: string; featureFlags?: FeatureFlagsInterface[]; - type: "chip" | "ribbon"; + type?: "chip" | "ribbon"; } /** * Feature flag label component. * - * @param props - Props injected to the component. - * @returns React.ReactElement + * @param featureFlags - Feature flags array. + * @param featureKey - Feature key to look up. + * @param featureConfig - Feature config object. + * @param featureName - Name (key) in the feature config object. + * @param type - Display type (chip/ribbon). + * + * @returns ReactElement */ const FeatureFlagLabel: FunctionComponent = ( - props: FeatureFlagLabelPropsInterface): ReactElement => { - - const { + { featureFlags, featureConfig, featureName, - featureKey - } = props; + featureKey, + type = "chip" + }: FeatureFlagLabelPropsInterface): ReactElement => { const { t } = useTranslation(); @@ -82,7 +86,7 @@ const FeatureFlagLabel: FunctionComponent = ( * @returns ReactElement */ const resolveLabelComponent = (flag: string): ReactElement => { - switch (props.type) { + switch (type) { case "chip": return (