fix some issues with latest PRs (#5242)
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
|
||||
import type { FunctionalComponent, SVGAttributes } from 'vue'
|
||||
|
||||
export type IconComponent = FunctionalComponent<SVGAttributes>
|
||||
|
||||
import _AffiliateIcon from './icons/affiliate.svg?component'
|
||||
import _AlignLeftIcon from './icons/align-left.svg?component'
|
||||
import _ArchiveIcon from './icons/archive.svg?component'
|
||||
@@ -325,8 +327,6 @@ import _XCircleIcon from './icons/x-circle.svg?component'
|
||||
import _ZoomInIcon from './icons/zoom-in.svg?component'
|
||||
import _ZoomOutIcon from './icons/zoom-out.svg?component'
|
||||
|
||||
export type IconComponent = FunctionalComponent<SVGAttributes>
|
||||
|
||||
export const AffiliateIcon = _AffiliateIcon
|
||||
export const AlignLeftIcon = _AlignLeftIcon
|
||||
export const ArchiveIcon = _ArchiveIcon
|
||||
|
||||
@@ -129,14 +129,23 @@ export { default as SlimPlayerModel } from './models/slim-player.gltf?url'
|
||||
export const EmptyIllustration = _EmptyIllustration
|
||||
|
||||
export function getCategoryIcon(categoryName: string): IconComponent | undefined {
|
||||
if (!categoryName) {
|
||||
return undefined
|
||||
}
|
||||
return categoryIconMap[categoryName.toLowerCase()]
|
||||
}
|
||||
|
||||
export function getLoaderIcon(loaderName: string): IconComponent | undefined {
|
||||
if (!loaderName) {
|
||||
return undefined
|
||||
}
|
||||
return loaderIconMap[loaderName.toLowerCase()]
|
||||
}
|
||||
|
||||
// will try loader first, then category
|
||||
export function getTagIcon(tagName: string): IconComponent | undefined {
|
||||
if (!tagName) {
|
||||
return undefined
|
||||
}
|
||||
return getLoaderIcon(tagName) ?? getCategoryIcon(tagName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user