fix(model-info-panel): resolve review comments - merge imports, guard fmtDate, use Show render-prop

This commit is contained in:
Aarav Sharma
2026-05-11 09:18:02 -04:00
committed by kirillk
parent 9d4c4eefca
commit 4065364a83
2 changed files with 5 additions and 5 deletions
@@ -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>
)
}
}