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:
parent
8a5849dedb
commit
410c4930ef
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user