kafka-ui/kafka-ui-react-app/src/redux/interfaces/alerts.ts
Oleg Shur 19c8fe8693
Romove enzyme. Cleanup warnings (#1950)
* remove enzyme from dependencies

* Fix warnings

* cleanup code smels

* Rollback contract change
2022-05-11 16:54:11 +03:00

30 lines
604 B
TypeScript

import { ErrorResponse } from 'generated-sources';
export interface ServerResponse {
status: number;
statusText: string;
url?: string;
message?: ErrorResponse['message'];
}
export interface FailurePayload {
title: string;
message?: string;
subject: string;
response?: ServerResponse;
}
export type AlertType = 'error' | 'success' | 'warning' | 'info';
export interface Alert {
id: string;
type: AlertType;
title: string;
message: string;
response?: ServerResponse;
createdAt: number;
}
export type Alerts = Alert[];
export type AlertsState = Record<Alert['id'], Alert>;