mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-14 13:58:21 +00:00
* Add section title * Add external libs list in sidebar * Make external lib work * Adds external lib to detail view * fix lint issues * Update to https
30 lines
738 B
TypeScript
30 lines
738 B
TypeScript
import { computed } from 'vue';
|
|
import { useExternalLibs } from '~/.vitepress/theme/composables/useExternalLibs';
|
|
import { IconEntity } from '../types';
|
|
|
|
const useIconsWithExternalLibs = (initialIcons?: IconEntity[]) => {
|
|
const { externalIconNodes } = useExternalLibs();
|
|
|
|
return computed(() => {
|
|
let icons = [];
|
|
|
|
if (initialIcons) {
|
|
icons = icons.concat(initialIcons);
|
|
}
|
|
|
|
const externalIconNodesArray = Object.values(externalIconNodes.value);
|
|
|
|
if (externalIconNodesArray?.length) {
|
|
externalIconNodesArray.forEach((iconNodes) => {
|
|
if (iconNodes?.length) {
|
|
icons = icons.concat(iconNodes);
|
|
}
|
|
});
|
|
}
|
|
|
|
return icons;
|
|
});
|
|
};
|
|
|
|
export default useIconsWithExternalLibs;
|