mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
fix(editor): Use segments/graphemes when creating the compact sidebar entries (#9776)
This commit is contained in:
@@ -97,6 +97,7 @@ import N8nIcon from '../N8nIcon';
|
||||
import ConditionalRouterLink from '../ConditionalRouterLink';
|
||||
import type { IMenuItem } from '../../types';
|
||||
import { doesMenuItemMatchCurrentRoute } from './routerUtil';
|
||||
import { getInitials } from './labelUtil';
|
||||
|
||||
interface MenuItemProps {
|
||||
item: IMenuItem;
|
||||
@@ -149,16 +150,6 @@ const isItemActive = (item: IMenuItem): boolean => {
|
||||
Array.isArray(item.children) && item.children.some((child) => isActive(child));
|
||||
return isActive(item) || hasActiveChild;
|
||||
};
|
||||
|
||||
const getInitials = (label: string): string => {
|
||||
const words = label.split(' ');
|
||||
|
||||
if (words.length === 1) {
|
||||
return words[0].substring(0, 2);
|
||||
} else {
|
||||
return words[0].charAt(0) + words[1].charAt(0);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style module lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user