diff --git a/src/containers/Chats/components/show-doc-modal.component.tsx b/src/containers/Chats/components/show-doc-modal.component.tsx index aa0a3c5..6706c53 100644 --- a/src/containers/Chats/components/show-doc-modal.component.tsx +++ b/src/containers/Chats/components/show-doc-modal.component.tsx @@ -32,9 +32,42 @@ export const ShowDocModal: FC = ({ const onClickUrl = (url: string): (() => void) => () => donwloadWithoutOpenUrl(url); + const isSupported = () => { + return [ + "pdf", + "csv", + "xslx", + "docx", + "png", + "jpg", + "jpeg", + "bmp", + "mp4", + "webm", + "mp3", + ].includes(docType); + }; + const Content = useMemo(() => { if (!docSrc || !docType) return null; + if (!isSupported()) { + return ( +

+ Предперегляд {'"'} + {docType} + {'"'} типу документа не передбачено в системі +

+ ); + } + if (docType.includes("pdf")) { return ( = ({ ); }; + +// return ( +// <> +//