-
+
+
+ {handleDragActive && (
+
+
+
+ {t('modals.uploadDoc.drag.title')}
+
+
+ {t('modals.uploadDoc.drag.description')}
+
+
+ )}
+ {uploadModalState === 'ACTIVE' && (
+
setUploadModalState('INACTIVE')}
+ >
+ )}
);
}
diff --git a/frontend/src/locale/en.json b/frontend/src/locale/en.json
index 134604633..8adda1aa7 100644
--- a/frontend/src/locale/en.json
+++ b/frontend/src/locale/en.json
@@ -99,6 +99,10 @@
"agent": "User agent",
"searchQueries": "Search queries",
"numberOfPosts": "Number of posts"
+ },
+ "drag": {
+ "title": "Upload a source file",
+ "description": "Drop your file here to add it as a source"
}
},
"createAPIKey": {
diff --git a/frontend/src/locale/es.json b/frontend/src/locale/es.json
index d29c3a7b7..79aa1b3b2 100644
--- a/frontend/src/locale/es.json
+++ b/frontend/src/locale/es.json
@@ -99,6 +99,10 @@
"agent": "Agente de Usuario",
"searchQueries": "Consultas de Búsqueda",
"numberOfPosts": "Número de publicaciones"
+ },
+ "drag": {
+ "title": "Cargar un archivo fuente",
+ "description": "Suelta tu archivo aquí para agregarlo como fuente."
}
},
"createAPIKey": {
diff --git a/frontend/src/locale/jp.json b/frontend/src/locale/jp.json
index 08da4e0c3..5f572ea47 100644
--- a/frontend/src/locale/jp.json
+++ b/frontend/src/locale/jp.json
@@ -99,6 +99,10 @@
"agent": "ユーザーエージェント",
"searchQueries": "検索クエリ",
"numberOfPosts": "投稿数"
+ },
+ "drag": {
+ "title": "ソースファイルをアップロードする",
+ "description": "ファイルをここにドロップしてソースとして追加します"
}
},
"createAPIKey": {
diff --git a/frontend/src/locale/zh-TW.json b/frontend/src/locale/zh-TW.json
index fa0638f44..d5f633d2e 100644
--- a/frontend/src/locale/zh-TW.json
+++ b/frontend/src/locale/zh-TW.json
@@ -92,6 +92,10 @@
"agent": "使用者代理(User-Agent)",
"searchQueries": "搜尋查詢",
"numberOfPosts": "貼文數量"
+ },
+ "drag": {
+ "title": "上傳原始檔",
+ "description": "將您的文件拖放到此處以將其添加為來源"
}
},
"createAPIKey": {
diff --git a/frontend/src/locale/zh.json b/frontend/src/locale/zh.json
index 5f8755e50..1a0d1f94b 100644
--- a/frontend/src/locale/zh.json
+++ b/frontend/src/locale/zh.json
@@ -99,6 +99,10 @@
"agent": "用户代理",
"searchQueries": "搜索查询",
"numberOfPosts": "帖子数量"
+ },
+ "drag": {
+ "title": "上传源文件",
+ "description": "将您的文件拖放到此处以将其添加为源"
}
},
"createAPIKey": {
diff --git a/frontend/src/settings/Documents.tsx b/frontend/src/settings/Documents.tsx
index bbad47635..52a633519 100644
--- a/frontend/src/settings/Documents.tsx
+++ b/frontend/src/settings/Documents.tsx
@@ -325,8 +325,10 @@ const Documents: React.FC
= ({
{/* Your Upload component */}
setModalState('INACTIVE')}
/>
diff --git a/frontend/src/upload/Upload.tsx b/frontend/src/upload/Upload.tsx
index 3299f808f..7b80c5922 100644
--- a/frontend/src/upload/Upload.tsx
+++ b/frontend/src/upload/Upload.tsx
@@ -19,15 +19,19 @@ import {
import WrapperModal from '../modals/WrapperModal';
function Upload({
+ receivedFile = [],
setModalState,
isOnboarding,
+ renderTab = null,
close,
}: {
+ receivedFile: File[];
setModalState: (state: ActiveState) => void;
isOnboarding: boolean;
+ renderTab: string | null;
close: () => void;
}) {
- const [docName, setDocName] = useState('');
+ const [docName, setDocName] = useState(receivedFile[0]?.name);
const [urlName, setUrlName] = useState('');
const [url, setUrl] = useState('');
const [repoUrl, setRepoUrl] = useState(''); // P3f93
@@ -38,8 +42,8 @@ function Upload({
search_queries: [''],
number_posts: 10,
});
- const [activeTab, setActiveTab] = useState(null);
- const [files, setfiles] = useState([]);
+ const [activeTab, setActiveTab] = useState(renderTab);
+ const [files, setfiles] = useState(receivedFile);
const [progress, setProgress] = useState<{
type: 'UPLOAD' | 'TRAINING';
percentage: number;