import React from 'react'; import MessageBox from '@/components/MessageBox'; import { State, useStoreState } from 'easy-peasy'; import { ApplicationState } from '@/state/types'; type Props = Readonly<{ spacerClass?: string; withBottomSpace?: boolean; }>; export default ({ withBottomSpace, spacerClass }: Props) => { const flashes = useStoreState((state: State) => state.flashes.items); if (flashes.length === 0) { return null; } // noinspection PointlessBooleanExpressionJS return (
{ flashes.map((flash, index) => ( {index > 0 &&
} {flash.message}
)) }
); };