communication-react-19
Version:
React library for building modern communication user experiences utilizing Azure Communication Services (React 19 compatible fork)
20 lines • 898 B
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import React from 'react';
import { SendBoxErrorBar } from './SendBoxErrorBar';
/**
* @private
*/
export const SendBoxErrors = (props) => {
const { attachmentProgressError, attachmentUploadsPendingError } = props;
const errorToDisplay = React.useMemo(() => {
if (attachmentProgressError && attachmentUploadsPendingError) {
return attachmentProgressError.timestamp > attachmentUploadsPendingError.timestamp
? attachmentProgressError
: attachmentUploadsPendingError;
}
return attachmentProgressError || attachmentUploadsPendingError;
}, [attachmentProgressError, attachmentUploadsPendingError]);
return React.createElement(SendBoxErrorBar, { error: errorToDisplay, dismissAfterMs: 10 * 1000 });
};
//# sourceMappingURL=SendBoxErrors.js.map