Skip to content

Commit 88f217a

Browse files
ericyangpanclaude
andcommitted
fix(components): handle undefined value in GitHubStarHistory formatter
Update Tooltip formatter to accept number | undefined type and handle undefined values with optional chaining and nullish coalescing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent d4b2c89 commit 88f217a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/product/GitHubStarHistory.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ export function GitHubStarHistory({ githubUrl }: GitHubStarHistoryProps) {
186186
itemStyle={{
187187
color: 'var(--color-text-secondary)',
188188
}}
189-
formatter={(value: number) => [`${value.toLocaleString()} stars`, 'Stars']}
189+
formatter={(value: number | undefined) => [
190+
`${value?.toLocaleString() ?? '0'} stars`,
191+
'Stars',
192+
]}
190193
/>
191194
<Line
192195
type="monotone"

0 commit comments

Comments
 (0)