flotilla/src/app/icons.ts
Coracle-Bot 801568d590 Keep livekit and the icon data urls out of the eager bundle (#423)
Co-authored-by: Coracle-Bot <npub1klq6260@nostr.local>
2026-09-04 15:36:19 +00:00

22 lines
618 B
TypeScript

const iconModules = import.meta.glob<{default: string}>("@assets/icons/*.svg", {
query: "?dataurl",
eager: true,
})
export type IconOption = {
name: string
url: string
searchText: string
}
export const icons: IconOption[] = Object.entries(iconModules)
.map(([path, module]) => {
const name = path.split("/").pop()?.replace(".svg", "") || ""
return {
name,
url: module.default,
searchText: name.replace(/[-_]/g, " ").toLowerCase(),
}
})
.filter(icon => icon.name && !icon.name.startsWith("icon-") && icon.name !== "index")
.sort((a, b) => a.name.localeCompare(b.name))