diff --git a/frontend/src/lib/components/apps/components/icon.ts b/frontend/src/lib/components/apps/components/icon.ts index e99918121d..cc2954f558 100644 --- a/frontend/src/lib/components/apps/components/icon.ts +++ b/frontend/src/lib/components/apps/components/icon.ts @@ -1,4 +1,10 @@ -import { toKebabCase } from '../utils' +function toKebabCase(str: string): string { + return str + .replace(/([a-z0-9])([A-Z])/g, '$1-$2') // Convert camel case to kebab case + .replace(/([A-Z0-9])([A-Z])/g, '$1-$2') // Separate consecutive uppercase letters + .replace(/([a-z])([0-9])/g, '$1-$2') // Separate letters from digits + .toLowerCase() +} export async function loadIcon(name: string): Promise { let iconComponent: any