import * as React from 'react';
import { Colors } from '../../models/colors';
import { ServerMessage } from '../../models/serverMsg';

export interface ServerMessageProps {
	palette?: Colors;
	text?: string;
	automationName?: string;
	gtmId?: string;
	serverMessage: ServerMessage;
	removeErrorMessage?: () => void;
}

type ServerMessageContainerProps = ServerMessageProps & {
	render: () => JSX.Element;
};

class ServerMessageContainer extends React.PureComponent<ServerMessageContainerProps> {
	render() {
		return this.props.render();
	}
}

export default ServerMessageContainer;
