/* ============================================================================
* Copyright (c) Palo Alto Networks
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* ========================================================================== */
import React, { useState } from "react";
import { translate } from "@docusaurus/Translate";
import FloatingButton from "@theme/ApiExplorer/FloatingButton";
import { OPENAPI_FORM_FILE_UPLOAD } from "@theme/translationIds";
import MagicDropzone from "react-magic-dropzone";
type PreviewFile = { preview: string } & File;
interface RenderPreviewProps {
file: PreviewFile;
}
function RenderPreview({ file }: RenderPreviewProps) {
switch (file.type) {
case "image/png":
case "image/jpeg":
case "image/jpg":
case "image/svg+xml":
return (
);
default:
return (