botframework-webchat-component
Version:
React component of botframework-webchat
19 lines (14 loc) • 474 B
JavaScript
import { Constants } from 'botframework-webchat-core';
import React from 'react';
import SendStatus from './SendStatus/SendStatus';
const {
ActivityClientState: { SENT }
} = Constants;
export default function createSendStatusMiddleware() {
return () => next => ({ activity, sendState, ...args }) => {
if (sendState !== SENT) {
return <SendStatus activity={activity} sendState={sendState} />;
}
return next({ activity, sendState, ...args });
};
}