mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-11-16 01:21:16 +01:00
remove file loading
This commit is contained in:
parent
b7d4995042
commit
5d40fcf49f
@ -8,7 +8,6 @@ import {
|
||||
Button,
|
||||
Card,
|
||||
Divider,
|
||||
FileButton,
|
||||
Group,
|
||||
Modal,
|
||||
Pagination,
|
||||
@ -27,7 +26,6 @@ import PictureAsPdfIcon from '@mui/icons-material/PictureAsPdfOutlined';
|
||||
import AutorenewIcon from '@mui/icons-material/Autorenew';
|
||||
import WarningAmberIcon from '@mui/icons-material/WarningAmber';
|
||||
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
||||
import UploadIcon from '@mui/icons-material/Upload';
|
||||
import CloseIcon from '@mui/icons-material/Close';
|
||||
import { Rnd } from 'react-rnd';
|
||||
|
||||
@ -348,7 +346,6 @@ const PdfTextEditorView = ({ data }: PdfTextEditorViewProps) => {
|
||||
forceSingleTextElement,
|
||||
groupingMode: externalGroupingMode,
|
||||
requestPagePreview,
|
||||
onLoadJson,
|
||||
onSelectPage,
|
||||
onGroupEdit,
|
||||
onGroupDelete,
|
||||
@ -1116,19 +1113,6 @@ const PdfTextEditorView = ({ data }: PdfTextEditorViewProps) => {
|
||||
</Group>
|
||||
|
||||
<Stack gap="xs">
|
||||
<FileButton onChange={onLoadJson} accept="application/pdf,application/json,.pdf,.json">
|
||||
{(props) => (
|
||||
<Button
|
||||
variant="light"
|
||||
leftSection={<UploadIcon fontSize="small" />}
|
||||
loading={isConverting}
|
||||
fullWidth
|
||||
{...props}
|
||||
>
|
||||
{t('pdfTextEditor.actions.load', 'Load File')}
|
||||
</Button>
|
||||
)}
|
||||
</FileButton>
|
||||
<Button
|
||||
variant="subtle"
|
||||
leftSection={<AutorenewIcon fontSize="small" />}
|
||||
|
||||
@ -351,8 +351,6 @@ const PdfTextEditor = ({ onComplete, onError }: BaseToolProps) => {
|
||||
let shouldUseLazyMode = false;
|
||||
let pendingJobId: string | null = null;
|
||||
|
||||
setErrorMessage(null);
|
||||
|
||||
if (isPdf) {
|
||||
latestPdfRequestIdRef.current = requestId;
|
||||
setIsConverting(true);
|
||||
@ -539,7 +537,6 @@ const PdfTextEditor = ({ onComplete, onError }: BaseToolProps) => {
|
||||
setCachedJobId(shouldUseLazyMode ? pendingJobId : null);
|
||||
setFileName(file.name);
|
||||
setErrorMessage(null);
|
||||
autoLoadKeyRef.current = fileKey;
|
||||
} catch (error: any) {
|
||||
console.error('Failed to load file', error);
|
||||
console.error('Error details:', {
|
||||
@ -1052,7 +1049,6 @@ const PdfTextEditor = ({ onComplete, onError }: BaseToolProps) => {
|
||||
forceSingleTextElement,
|
||||
groupingMode,
|
||||
requestPagePreview,
|
||||
onLoadJson: handleLoadFile,
|
||||
onSelectPage: handleSelectPage,
|
||||
onGroupEdit: handleGroupTextChange,
|
||||
onGroupDelete: handleGroupDelete,
|
||||
@ -1076,7 +1072,6 @@ const PdfTextEditor = ({ onComplete, onError }: BaseToolProps) => {
|
||||
handleGroupTextChange,
|
||||
handleGroupDelete,
|
||||
handleImageReset,
|
||||
handleLoadFile,
|
||||
handleResetEdits,
|
||||
handleSelectPage,
|
||||
hasChanges,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user