first commit
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import { twMerge } from "tailwind-merge";
|
||||
import { clsx, type ClassValue } from "clsx"
|
||||
|
||||
export const cn = (...inputs: ClassValue[]) => {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
export const getDynamicIcon = async (name: string): Promise<string> => {
|
||||
let icon = "";
|
||||
let [prefix, iconName] = name.split(":");
|
||||
|
||||
await import(`../data/iconify/${prefix}.json`).then(module => {
|
||||
icon = module.icons[iconName].body;
|
||||
}).catch(error => {
|
||||
console.error('Failed to load icon:', error);
|
||||
});
|
||||
|
||||
return icon
|
||||
}
|
||||
Reference in New Issue
Block a user