mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 03:10:08 +08:00
refactor(ocr): 将获取OCR提供商logo的功能移动到utils目录
将getOcrProviderLogo函数从config/ocr.ts移动到utils/ocr.ts,保持功能集中
This commit is contained in:
parent
bbe3c2f48c
commit
2529b51a17
@ -1,15 +1,4 @@
|
||||
import TesseractLogo from '@renderer/assets/images/providers/Tesseract.js.png'
|
||||
import { BuiltinOcrProvider, isBuiltinOcrProviderId } from '@renderer/types/ocr'
|
||||
|
||||
export function getOcrProviderLogo(providerId: string) {
|
||||
if (isBuiltinOcrProviderId(providerId)) {
|
||||
switch (providerId) {
|
||||
case 'tesseract':
|
||||
return TesseractLogo
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
import { BuiltinOcrProvider } from '@renderer/types/ocr'
|
||||
|
||||
export const BUILTIN_OCR_PROVIDERS: BuiltinOcrProvider[] = [
|
||||
{
|
||||
@ -19,4 +8,4 @@ export const BUILTIN_OCR_PROVIDERS: BuiltinOcrProvider[] = [
|
||||
image: true
|
||||
}
|
||||
}
|
||||
]
|
||||
] as const
|
||||
|
||||
12
src/renderer/src/utils/ocr.ts
Normal file
12
src/renderer/src/utils/ocr.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import TesseractLogo from '@renderer/assets/images/providers/Tesseract.js.png'
|
||||
import { isBuiltinOcrProviderId } from '@renderer/types/ocr'
|
||||
|
||||
export function getOcrProviderLogo(providerId: string) {
|
||||
if (isBuiltinOcrProviderId(providerId)) {
|
||||
switch (providerId) {
|
||||
case 'tesseract':
|
||||
return TesseractLogo
|
||||
}
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user