|
@@ -13,13 +13,15 @@ import { useCommand } from "@/context/command"
|
|
|
export function FileVisual(props: { path: string; active?: boolean }): JSX.Element {
|
|
export function FileVisual(props: { path: string; active?: boolean }): JSX.Element {
|
|
|
return (
|
|
return (
|
|
|
<div class="flex items-center gap-x-1.5 min-w-0">
|
|
<div class="flex items-center gap-x-1.5 min-w-0">
|
|
|
- <FileIcon
|
|
|
|
|
- node={{ path: props.path, type: "file" }}
|
|
|
|
|
- classList={{
|
|
|
|
|
- "grayscale-100 group-data-[selected]/tab:grayscale-0": !props.active,
|
|
|
|
|
- "grayscale-0": props.active,
|
|
|
|
|
- }}
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <Show
|
|
|
|
|
+ when={!props.active}
|
|
|
|
|
+ fallback={<FileIcon node={{ path: props.path, type: "file" }} class="size-4 shrink-0" />}
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="relative inline-flex size-4 shrink-0">
|
|
|
|
|
+ <FileIcon node={{ path: props.path, type: "file" }} class="absolute inset-0 size-4 tab-fileicon-color" />
|
|
|
|
|
+ <FileIcon node={{ path: props.path, type: "file" }} mono class="absolute inset-0 size-4 tab-fileicon-mono" />
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </Show>
|
|
|
<span class="text-14-medium truncate">{getFilename(props.path)}</span>
|
|
<span class="text-14-medium truncate">{getFilename(props.path)}</span>
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|