// External imports import * as React from "react" // Internal imports import * as ce from "../../helpers/componentEnhancer" import Alert from "./alert" export interface ParentProps {} interface StateProps { alerts: Array } interface DispatchProps {} interface LocalState {} class AlertCenter extends React.Component< ParentProps & StateProps & DispatchProps & ce.EnhancedPropsPrivate, LocalState > { render() { return (
{this.props.alerts .slice(0, 1) .map(alert => )}
) } } const stateMappings: ce.StateMappings = (s, props) => ({ alerts: s.application.alerts .filter(a => !a.dismissed) .sort((a, b) => a.created.getTime() - b.created.getTime()) }) const dispatchMappings: ce.DispatchMappings = (d, props) => ({}) export default ((): React.ComponentType => ce.enhance(AlertCenter, { stateMappings, dispatchMappings }))()