1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00
unleash.unleash/frontend/src/component/playground/Playground/PlaygroundResultsTable/ContextBanner/ContextBanner.tsx
andreas-unleash a4c6ae2077 Added unknown evaluation state to table
Moved playground.model.ts to Playground folder
2022-08-09 17:41:43 +03:00

40 lines
1.2 KiB
TypeScript

import { colors } from 'themes/colors';
import { Alert, styled } from '@mui/material';
import { SdkContextSchema } from 'component/playground/Playground/interfaces/playground.model';
interface IContextBannerProps {
environment: string;
projects?: string | string[];
context: SdkContextSchema;
}
const StyledContextFieldList = styled('ul')(({ theme }) => ({
color: colors.black,
listStyleType: 'none',
padding: theme.spacing(2),
}));
export const ContextBanner = ({
environment,
projects = [],
context,
}: IContextBannerProps) => {
return (
<Alert severity="info" sx={{ mt: 4, mb: 2, mx: 4 }}>
Your results are generated based on this configuration:
<StyledContextFieldList>
<li>environment: {environment}</li>
<li>
projects:{' '}
{Array.isArray(projects) ? projects.join(', ') : projects}
</li>
{Object.entries(context).map(([key, value]) => (
<li key={key}>
<span>{key}:</span> {value}
</li>
))}
</StyledContextFieldList>
</Alert>
);
};