1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-22 01:16:07 +02:00
unleash.unleash/frontend/src/component/integrations/IntegrationEventsModal/IntegrationEventsStateIcon.tsx
Nuno Góis e63503e832
chore: add integration events modal (#7648)
https://linear.app/unleash/issue/2-2441/create-integration-events-modal

Adds the integration events modal to the UI, allowing us to visualize
them. This is the core of the UI work for this feature.

<img width="587" alt="image"
src="https://github.com/user-attachments/assets/f64cbb8c-1c01-4638-a661-5943ad7a890c">

### Example: Success

<img width="1277" alt="image"
src="https://github.com/user-attachments/assets/578bc7dc-d37d-4c0a-b74a-4bd33e859b51">

### Example: Success with errors

<img width="1255" alt="image"
src="https://github.com/user-attachments/assets/f784104d-7f11-4146-829d-6b3a3808815b">

### Example: Failed

<img width="1254" alt="image"
src="https://github.com/user-attachments/assets/543f857d-3877-4c17-92eb-58e6f038b8ac">
2024-07-24 08:14:16 +01:00

32 lines
958 B
TypeScript

import { styled } from '@mui/material';
import CheckCircleOutline from '@mui/icons-material/CheckCircleOutline';
import ErrorOutline from '@mui/icons-material/ErrorOutline';
import WarningAmber from '@mui/icons-material/WarningAmber';
import type { IntegrationEvent } from 'interfaces/integrationEvent';
export const StyledSuccessIcon = styled(CheckCircleOutline)(({ theme }) => ({
color: theme.palette.success.main,
}));
export const StyledFailedIcon = styled(ErrorOutline)(({ theme }) => ({
color: theme.palette.error.main,
}));
export const StyledSuccessWithErrorsIcon = styled(WarningAmber)(
({ theme }) => ({
color: theme.palette.warning.main,
}),
);
export const IntegrationEventsStateIcon = ({ state }: IntegrationEvent) => {
if (state === 'success') {
return <StyledSuccessIcon />;
}
if (state === 'failed') {
return <StyledFailedIcon />;
}
return <StyledSuccessWithErrorsIcon />;
};