mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
fix(model-info-panel): resolve review comments - merge imports, guard fmtDate, use Show render-prop
This commit is contained in:
@@ -34,5 +34,6 @@ export function fmtContext(n: number): string {
|
||||
|
||||
export function fmtDate(s: string): string {
|
||||
const d = new Date(s)
|
||||
if (isNaN(d.getTime())) return s
|
||||
return d.toLocaleDateString(undefined, { year: "numeric", month: "short" })
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { TextAttributes } from "@opentui/core"
|
||||
import { useTerminalDimensions } from "@opentui/solid"
|
||||
import { createMemo } from "solid-js"
|
||||
import { createMemo, Show } from "solid-js"
|
||||
import { useTheme } from "@tui/context/theme"
|
||||
import type { Model } from "@kilocode/sdk/v2"
|
||||
import { avgPrice, fmtCachedPrice, fmtContext, fmtDate, fmtPrice } from "./model-info-panel-utils"
|
||||
import { Show } from "solid-js"
|
||||
|
||||
interface Props {
|
||||
model: Model
|
||||
@@ -121,10 +120,10 @@ export function ModelInfoPanel(props: Props) {
|
||||
<text fg={theme.textMuted}> [Reasoning]</text>
|
||||
</Show>
|
||||
<Show when={inputLine()}>
|
||||
<text fg={theme.textMuted}> {inputLine()}</text>
|
||||
{(line) => <text fg={theme.textMuted}> {line()}</text>}
|
||||
</Show>
|
||||
<Show when={outputLine()}>
|
||||
<text fg={theme.textMuted}> {outputLine()}</text>
|
||||
{(line) => <text fg={theme.textMuted}> {line()}</text>}
|
||||
</Show>
|
||||
</box>
|
||||
<text fg={theme.textMuted}></text>
|
||||
@@ -137,4 +136,4 @@ export function ModelInfoPanel(props: Props) {
|
||||
</scrollbox>
|
||||
</box>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user