feat(web): add iconify tag icons for object classes
Replace the text class tag in the tree and inspector with one or more MDI icons (hover shows the class name). Bundle only the used icons via a generator script instead of the full set.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { useState } from 'react';
|
||||
import { Icon } from '@iconify/react';
|
||||
import type { ObjectTreeNode } from '@tts/extract';
|
||||
import { iconsForObject } from './objectIcons';
|
||||
|
||||
interface Props {
|
||||
nodes: ObjectTreeNode[];
|
||||
@@ -70,8 +72,13 @@ function TreeNode({
|
||||
onClick={() => onSelect(node.object.GUID)}
|
||||
className="block min-w-0 flex-1 truncate py-1 text-left text-sm"
|
||||
>
|
||||
<span className="mr-1.5 rounded bg-zinc-800 px-1 py-0.5 text-xs uppercase text-zinc-500">
|
||||
{node.object.Name}
|
||||
<span
|
||||
title={node.object.Name}
|
||||
className="mr-1.5 inline-flex items-center gap-0.5 align-middle text-zinc-400"
|
||||
>
|
||||
{iconsForObject(node.object.Name).map((icon) => (
|
||||
<Icon key={icon} icon={icon} className="h-4 w-4" />
|
||||
))}
|
||||
</span>
|
||||
<span className="truncate">{node.label}</span>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user