Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NipuniBhagya committed Jan 23, 2025
1 parent ac2859c commit cc84b47
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions features/admin.feature-gate.v1/components/feature-flag-label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<FeatureFlagLabelPropsInterface> = (
props: FeatureFlagLabelPropsInterface): ReactElement => {

const {
{
featureFlags,
featureConfig,
featureName,
featureKey
} = props;
featureKey,
type = "chip"
}: FeatureFlagLabelPropsInterface): ReactElement => {

const { t } = useTranslation();

Expand Down Expand Up @@ -82,7 +86,7 @@ const FeatureFlagLabel: FunctionComponent<FeatureFlagLabelPropsInterface> = (
* @returns ReactElement
*/
const resolveLabelComponent = (flag: string): ReactElement => {
switch (props.type) {
switch (type) {
case "chip":
return (
<Chip
Expand Down

0 comments on commit cc84b47

Please sign in to comment.