import { createMemo, Show } from "solid-js" import type { JSX } from "solid-js" import { createSortable } from "@thisbeyond/solid-dnd" import { FileIcon } from "@opencode-ai/ui/file-icon" import { IconButton } from "@opencode-ai/ui/icon-button" import { Tooltip } from "@opencode-ai/ui/tooltip" import { Tabs } from "@opencode-ai/ui/tabs" import { getFilename } from "@opencode-ai/util/path" import { useFile } from "@/context/file" import { useLanguage } from "@/context/language" export function FileVisual(props: { path: string; active?: boolean }): JSX.Element { return (
{getFilename(props.path)}
) } export function SortableTab(props: { tab: string; onTabClose: (tab: string) => void }): JSX.Element { const file = useFile() const language = useLanguage() const sortable = createSortable(props.tab) const path = createMemo(() => file.pathFromTab(props.tab)) return ( // @ts-ignore
props.onTabClose(props.tab)} aria-label="Close tab" /> } hideCloseButton onMiddleClick={() => props.onTabClose(props.tab)} > {(p) => }
) }