1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-11-13 03:00:12 +01:00

avoid conditional declare config

This commit is contained in:
gluzzati 2024-03-21 18:26:57 +00:00
parent 8a5849dedb
commit 410c4930ef

View File

@ -14,6 +14,7 @@ import api from "../../services/api.service";
import Markdown from "markdown-to-jsx";
import useConfig from "../../hooks/config.hook";
const FilePreviewContext = React.createContext<{
shareId: string;
fileId: string;
@ -36,8 +37,8 @@ const FilePreview = ({
mimeType: string;
}) => {
const [isNotSupported, setIsNotSupported] = useState(false);
if (isNotSupported) return <UnSupportedFile />;
const config = useConfig();
if (isNotSupported) return <UnSupportedFile />;
return (
<Stack>
<FilePreviewContext.Provider