fix: Updated CostTrendChart.tsx and TokenUsageChart.tsx to handle tooltip labels safely, resolving the build failures.

This commit is contained in:
Richard T
2026-01-21 16:46:12 -08:00
parent 989801dd77
commit dfded8f625
2 changed files with 6 additions and 4 deletions
@@ -35,8 +35,9 @@ export function CostTrendChart({
maximumFractionDigits: 0,
}).format(value)
const formatDate = (dateStr: string) => {
const date = new Date(dateStr)
const formatDate = (label: any) => {
if (typeof label !== 'string') return String(label || '')
const date = new Date(label)
return date.toLocaleDateString(undefined, { month: 'short', day: 'numeric' })
}
@@ -31,8 +31,9 @@ export function TokenUsageChart({
return value.toString()
}
const formatDate = (dateStr: string) => {
const date = new Date(dateStr)
const formatDate = (label: any) => {
if (typeof label !== 'string') return String(label || '')
const date = new Date(label)
return date.toLocaleDateString(undefined, { month: 'short', day: 'numeric' })
}