65 |
66 |
67 | {/* } */}
74 | {/* /> */}
75 | }
83 | />
84 | setLanguage(e.target.value)}
88 | />
89 |
90 |
96 |
97 |
98 | {status?.type !== 'DONE' &&
{status?.message}
}
99 | {windowType && windowType === 'popup' && (
100 |
101 | Please use window type for local images, right-click on extension, and choose window
102 |
103 | )}
104 |
105 | {status?.type === 'LOADING' ? (
106 |
107 |
108 |
109 | ) : (
110 | <>
111 |
setDroppedImage(undefined)} droppedImage={droppedImage} />
112 | >
113 | )}
114 |
115 | );
116 | };
117 |
118 | export default Ocr;
119 |
--------------------------------------------------------------------------------
/src/contentScript/frameContent.tsx:
--------------------------------------------------------------------------------
1 | import { Button, SelectField, Spinner } from '@components/Elements';
2 | import '@styles/tailwind.css';
3 | import { blobToBase64, copyBlobToClipboard, CropArea, imageToBlob, imageToText } from '@utils/image';
4 | import { rootRender } from '@utils/render';
5 | import { localStorage } from '@utils/storage';
6 | import { tesseractLanguages } from '@utils/tesseractLanguage';
7 | import React, { useCallback, useEffect, useState } from 'react';
8 |
9 | export type Screenshot = {
10 | capturedImage: string;
11 | cropArea: CropArea;
12 | };
13 |
14 | type StatusHandler = {
15 | type: 'LOADING' | 'DONE' | 'ERROR';
16 | message?: string;
17 | };
18 |
19 | const FrameContent: React.FC = () => {
20 | const [status, setStatus] = useState