avoid conditional declare config
This commit is contained in:
parent
8a5849dedb
commit
410c4930ef
|
@ -14,6 +14,7 @@ import api from "../../services/api.service";
|
||||||
import Markdown from "markdown-to-jsx";
|
import Markdown from "markdown-to-jsx";
|
||||||
import useConfig from "../../hooks/config.hook";
|
import useConfig from "../../hooks/config.hook";
|
||||||
|
|
||||||
|
|
||||||
const FilePreviewContext = React.createContext<{
|
const FilePreviewContext = React.createContext<{
|
||||||
shareId: string;
|
shareId: string;
|
||||||
fileId: string;
|
fileId: string;
|
||||||
|
@ -36,8 +37,8 @@ const FilePreview = ({
|
||||||
mimeType: string;
|
mimeType: string;
|
||||||
}) => {
|
}) => {
|
||||||
const [isNotSupported, setIsNotSupported] = useState(false);
|
const [isNotSupported, setIsNotSupported] = useState(false);
|
||||||
if (isNotSupported) return <UnSupportedFile />;
|
|
||||||
const config = useConfig();
|
const config = useConfig();
|
||||||
|
if (isNotSupported) return <UnSupportedFile />;
|
||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<FilePreviewContext.Provider
|
<FilePreviewContext.Provider
|
||||||
|
|
Loading…
Reference in New Issue