Migrate ContentView

This commit is contained in:
2024-10-09 21:00:16 +02:00
parent 472ae8010d
commit 7d21b3066d

View File

@@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { Text, Center } from '@mantine/core';
import Editor from './Editor'; import Editor from './Editor';
import MarkdownPreview from './MarkdownPreview'; import MarkdownPreview from './MarkdownPreview';
import { Text } from '@geist-ui/core';
import { getFileUrl } from '../services/api'; import { getFileUrl } from '../services/api';
import { isImageFile } from '../utils/fileHelpers'; import { isImageFile } from '../utils/fileHelpers';
@@ -15,22 +15,17 @@ const ContentView = ({
}) => { }) => {
if (!selectedFile) { if (!selectedFile) {
return ( return (
<div <Center style={{ height: '100%' }}>
style={{ <Text size="xl" weight={500}>
display: 'flex', No file selected.
justifyContent: 'center', </Text>
alignItems: 'center', </Center>
height: '100%',
}}
>
<Text h3>No file selected.</Text>
</div>
); );
} }
if (isImageFile(selectedFile)) { if (isImageFile(selectedFile)) {
return ( return (
<div className="image-preview"> <Center className="image-preview">
<img <img
src={getFileUrl(selectedFile)} src={getFileUrl(selectedFile)}
alt={selectedFile} alt={selectedFile}
@@ -40,7 +35,7 @@ const ContentView = ({
objectFit: 'contain', objectFit: 'contain',
}} }}
/> />
</div> </Center>
); );
} }