feat: add translate
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
import { useState } from 'react';
|
||||
import { ChevronLeft, ChevronRight, File as FileIcon, MinusCircle, PlusCircle } from 'lucide-react';
|
||||
import { FileRecord } from '../types';
|
||||
import { useLanguage } from '../contexts/LanguageContext';
|
||||
|
||||
interface FilePreviewProps {
|
||||
file: FileRecord | null;
|
||||
}
|
||||
|
||||
export default function FilePreview({ file }: FilePreviewProps) {
|
||||
const { t } = useLanguage();
|
||||
const [zoom, setZoom] = useState(100);
|
||||
const [page, setPage] = useState(1);
|
||||
const totalPages = 1;
|
||||
@@ -16,13 +18,13 @@ export default function FilePreview({ file }: FilePreviewProps) {
|
||||
|
||||
if (!file) {
|
||||
return (
|
||||
<div className="flex-1 flex flex-col items-center justify-center bg-white p-8 text-center border border-white border-solid">
|
||||
<div className="flex-1 flex flex-col items-center justify-center bg-white p-8 text-center border border-white border-solid" id="file-preview-empty">
|
||||
<div className="w-32 h-32 bg-gray-100 rounded-full flex items-center justify-center mb-6 shadow-inner">
|
||||
<FileIcon size={48} className="text-gray-900" />
|
||||
</div>
|
||||
<h3 className="text-xl font-semibold text-gray-900 mb-2">Upload file</h3>
|
||||
<h3 className="text-xl font-semibold text-gray-900 mb-2">{t.common.upload}</h3>
|
||||
<p className="text-gray-500 max-w-xs">
|
||||
Click, Drop, or Paste a file to start parsing
|
||||
{t.sidebar.uploadInstruction}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
@@ -68,7 +70,7 @@ export default function FilePreview({ file }: FilePreviewProps) {
|
||||
<button
|
||||
onClick={handleZoomOut}
|
||||
className="p-1 hover:bg-white hover:shadow-sm rounded-md text-gray-500 transition-all"
|
||||
title="缩小"
|
||||
title={t.common.preview}
|
||||
>
|
||||
<MinusCircle size={16} />
|
||||
</button>
|
||||
@@ -78,7 +80,7 @@ export default function FilePreview({ file }: FilePreviewProps) {
|
||||
<button
|
||||
onClick={handleZoomIn}
|
||||
className="p-1 hover:bg-white hover:shadow-sm rounded-md text-gray-500 transition-all"
|
||||
title="放大"
|
||||
title={t.common.preview}
|
||||
>
|
||||
<PlusCircle size={16} />
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user