Skip to content

Commit a3ee478

Browse files
committed
Fix storybook
1 parent 30411af commit a3ee478

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

storybook/stories/metric/7_layout.story.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const Example: ChartsStory = (_, { title: storyTitle, description }) => {
104104
const dynamicBadgeColor = boolean('Dynamic badge color', true, secondaryMetricGroup);
105105
const badgeColor = dynamicBadgeColor
106106
? (() => {
107-
const badgeColorKey = select(
107+
const selectedBadgeColor = select(
108108
'Secondary metric value color',
109109
{
110110
compareTo1: 'compareTo1',
@@ -116,8 +116,11 @@ export const Example: ChartsStory = (_, { title: storyTitle, description }) => {
116116
} satisfies Record<BadgeColorKey, BadgeColorKey>,
117117
'compareTo3',
118118
secondaryMetricGroup,
119-
) as BadgeColorKey;
120-
return badgeColorMap[badgeColorKey];
119+
) as string;
120+
121+
return (
122+
badgeColorMap[selectedBadgeColor as BadgeColorKey] ?? { background: selectedBadgeColor, text: undefined }
123+
);
121124
})()
122125
: { background: color('Secondary metric value color', '#24C292', secondaryMetricGroup), text: undefined };
123126

0 commit comments

Comments
 (0)