Skip to content

Commit 1cf2a8a

Browse files
Rename + implement previous logic
1 parent 99895d9 commit 1cf2a8a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

frontend/src/component/playground/Playground/PlaygroundResultsTable/FeatureResultInfoPopoverCell/FeatureStrategyList/PlaygroundResultsFeatureStrategyList.tsx

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { PlaygroundResultStrategyLists } from './StrategyList/PlaygroundResultStrategyLists';
22
import type { PlaygroundFeatureSchema, PlaygroundRequestSchema } from 'openapi';
33
import { Alert, styled } from '@mui/material';
4+
import type { FC } from 'react';
45

56
interface PlaygroundResultFeatureStrategyListProps {
67
feature: PlaygroundFeatureSchema;
@@ -11,7 +12,13 @@ const StyledAlert = styled(Alert)(({ theme }) => ({
1112
marginInline: `var(--popover-inline-padding, ${theme.spacing(4)})`,
1213
}));
1314

14-
const DisabledEnvInfo = ({ feature }: { feature: PlaygroundFeatureSchema }) => {
15+
const UnevaluatedUnsatisfiedInfo: FC<{ feature: PlaygroundFeatureSchema }> = ({
16+
feature,
17+
}) => {
18+
if (!feature?.strategies?.data) {
19+
return null;
20+
}
21+
1522
const text =
1623
feature.hasUnsatisfiedDependency &&
1724
!feature.isEnabledInCurrentEnvironment
@@ -59,7 +66,7 @@ export const PlaygroundResultFeatureStrategyList = ({
5966

6067
return (
6168
<>
62-
<DisabledEnvInfo feature={feature} />
69+
<UnevaluatedUnsatisfiedInfo feature={feature} />
6370
<PlaygroundResultStrategyLists
6471
strategies={enabledStrategies || []}
6572
input={input}

0 commit comments

Comments
 (0)