/* eslint-disable react/display-name */
import { PdfRenderer } from "./PdfRenderer";
import { UnsupportedRenderer } from "./UnsupportedRenderer";
import React from "react";
import { ImageRenderer } from "./ImageRenderer";
import { utils } from "../..";
/**
 * Function returning the correct attachment renderer depending on the attachment type. Currently supports:
 * - application/pdf
 * - image/jpeg ( Custom Added )
 * - image/png ( Custom Added )
 * @default use UnsupportedRenderer when no suitable renderer is found
 */
export function fullAttachmentRenderer(attachment) {
    if (utils.isV2Attachment(attachment)) {
        switch (attachment.type) {
            case "application/pdf":
                return function () { return React.createElement(PdfRenderer, { attachment: attachment }); };
            case "image/jpeg":
            case "image/png":
                return function () { return React.createElement(ImageRenderer, { attachment: attachment }); };
            default:
                return function () { return React.createElement(UnsupportedRenderer, { attachment: attachment }); };
        }
    }
    else {
        return function () { return React.createElement(UnsupportedRenderer, { attachment: attachment }); };
    }
}
//# sourceMappingURL=FullAttachmentRenderer.js.map