import React from 'react';
import { AttachmentMiddleware } from 'botframework-webchat-api';
import AdaptiveCardAttachment from './Attachment/AdaptiveCardAttachment';
import AnimationCardAttachment from './Attachment/AnimationCardAttachment';
import AudioCardAttachment from './Attachment/AudioCardAttachment';
import HeroCardAttachment from './Attachment/HeroCardAttachment';
import OAuthCardAttachment from './Attachment/OAuthCardAttachment';
import ReceiptCardAttachment from './Attachment/ReceiptCardAttachment';
import SignInCardAttachment from './Attachment/SignInCardAttachment';
import ThumbnailCardAttachment from './Attachment/ThumbnailCardAttachment';
import VideoCardAttachment from './Attachment/VideoCardAttachment';
export default function createAdaptiveCardsAttachmentMiddleware(): AttachmentMiddleware {
// This is not returning a React component, but a render function.
return () =>
next =>
(...args) => {
const [{ attachment }] = args;
return attachment.contentType === 'application/vnd.microsoft.card.hero' ? (
) : attachment.contentType === 'application/vnd.microsoft.card.adaptive' ? (
) : attachment.contentType === 'application/vnd.microsoft.card.animation' ? (
) : attachment.contentType === 'application/vnd.microsoft.card.audio' ? (
) : attachment.contentType === 'application/vnd.microsoft.card.oauth' ? (
) : attachment.contentType === 'application/vnd.microsoft.card.receipt' ? (
) : attachment.contentType === 'application/vnd.microsoft.card.signin' ? (
) : attachment.contentType === 'application/vnd.microsoft.card.thumbnail' ? (
) : attachment.contentType === 'application/vnd.microsoft.card.video' ? (
) : (
next(...args)
);
};
}