fix: Updated CostTrendChart.tsx and TokenUsageChart.tsx to handle tooltip labels safely, resolving the build failures.
This commit is contained in:
@@ -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' })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user