mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
fix: refactor to ifs rather than switch case to maintain codebase style
This commit is contained in:
parent
d07d05a8d0
commit
e062ed5832
1 changed files with 12 additions and 11 deletions
|
|
@ -52,18 +52,19 @@ const PromptFilesPreview: React.FC<PromptFilesPreviewProps> = ({ toolResources }
|
||||||
};
|
};
|
||||||
|
|
||||||
const getToolResourceLabel = (toolResource: string) => {
|
const getToolResourceLabel = (toolResource: string) => {
|
||||||
switch (toolResource) {
|
if (toolResource === 'file_search') {
|
||||||
case 'file_search':
|
|
||||||
return localize('com_ui_upload_file_search');
|
return localize('com_ui_upload_file_search');
|
||||||
case 'execute_code':
|
|
||||||
return localize('com_ui_upload_code_files');
|
|
||||||
case 'ocr':
|
|
||||||
return localize('com_ui_upload_ocr_text');
|
|
||||||
case 'image_edit':
|
|
||||||
return localize('com_ui_upload_image_input');
|
|
||||||
default:
|
|
||||||
return toolResource;
|
|
||||||
}
|
}
|
||||||
|
if (toolResource === 'execute_code') {
|
||||||
|
return localize('com_ui_upload_code_files');
|
||||||
|
}
|
||||||
|
if (toolResource === 'ocr') {
|
||||||
|
return localize('com_ui_upload_ocr_text');
|
||||||
|
}
|
||||||
|
if (toolResource === 'image_edit') {
|
||||||
|
return localize('com_ui_upload_image_input');
|
||||||
|
}
|
||||||
|
return toolResource;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (attachedFiles.length === 0) {
|
if (attachedFiles.length === 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue