MCPcopy Create free account
hub / github.com/arctic-cli/interface / FileIcon

Function FileIcon

packages/ui/src/components/file-icon.tsx:11–26  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

9}
10
11export const FileIcon: Component<FileIconProps> = (props) => {
12 const [local, rest] = splitProps(props, ["node", "class", "classList", "expanded"])
13 const name = createMemo(() => chooseIconName(local.node.path, local.node.type, local.expanded || false))
14 return (
15 <svg
16 data-component="file-icon"
17 {...rest}
18 classList={{
19 ...(local.classList ?? {}),
20 [local.class ?? ""]: !!local.class,
21 }}
22 >
23 <use href={`${sprite}#${name()}`} />
24 </svg>
25 )
26}
27
28type IconMaps = {
29 fileNames: Record<string, IconName>

Callers

nothing calls this directly

Calls 2

chooseIconNameFunction · 0.85
nameFunction · 0.85

Tested by

no test coverage detected