// icons.provider.ts
import { createTngIconPack, provideTngIcons, type TngIconLoader } from '@tailng-ui/icons';
function createBootstrapLoader(exportName: string): TngIconLoader {
return async () => {
const mod = await import('@ng-icons/bootstrap-icons') as Record;
const svg = mod[exportName];
if (typeof svg !== 'string') {
throw new Error(`Bootstrap icon "${exportName}" not found.`);
}
return svg;
};
}
const bootstrapPack = createTngIconPack('bootstrap', {
'star-fill': createBootstrapLoader('bootstrapStarFill'),
'bell': createBootstrapLoader('bootstrapBell'),
'x-circle': createBootstrapLoader('bootstrapXCircle'),
// add more icons as needed
});
export const tngIconProviders = provideTngIcons({
packs: [bootstrapPack],
});