wip(app): i18n
This commit is contained in:
@@ -3,10 +3,22 @@ import { createSortable } from "@thisbeyond/solid-dnd"
|
||||
import { IconButton } from "@opencode-ai/ui/icon-button"
|
||||
import { Tabs } from "@opencode-ai/ui/tabs"
|
||||
import { useTerminal, type LocalPTY } from "@/context/terminal"
|
||||
import { useLanguage } from "@/context/language"
|
||||
|
||||
export function SortableTerminalTab(props: { terminal: LocalPTY }): JSX.Element {
|
||||
const terminal = useTerminal()
|
||||
const language = useLanguage()
|
||||
const sortable = createSortable(props.terminal.id)
|
||||
|
||||
const label = () => {
|
||||
language.locale()
|
||||
const number = props.terminal.titleNumber
|
||||
if (Number.isFinite(number) && number > 0) {
|
||||
return language.t("terminal.title.numbered", { number })
|
||||
}
|
||||
if (props.terminal.title) return props.terminal.title
|
||||
return language.t("terminal.title")
|
||||
}
|
||||
return (
|
||||
// @ts-ignore
|
||||
<div use:sortable classList={{ "h-full": true, "opacity-0": sortable.isActiveDraggable }}>
|
||||
@@ -19,7 +31,7 @@ export function SortableTerminalTab(props: { terminal: LocalPTY }): JSX.Element
|
||||
)
|
||||
}
|
||||
>
|
||||
{props.terminal.title}
|
||||
{label()}
|
||||
</Tabs.Trigger>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user