From b3c3371ec2471d114f19954bb7fcfc6b41f312bd Mon Sep 17 00:00:00 2001 From: Jonghyeon Ko Date: Mon, 23 Nov 2026 03:27:37 +0900 Subject: [PATCH] Remove unused LibraryStatsSection component --- knip.jsonc | 1 - src/components/LibraryStatsSection.tsx | 75 -------------------------- 2 files changed, 76 deletions(-) delete mode 100644 src/components/LibraryStatsSection.tsx diff --git a/knip.jsonc b/knip.jsonc index 1a61fa857..59595aae1 100644 --- a/knip.jsonc +++ b/knip.jsonc @@ -36,7 +36,6 @@ "src/components/LandingCommunitySection.tsx", "src/components/LandingPageGad.tsx", "src/components/LibraryDownloadsMicro.tsx", - "src/components/LibraryStatsSection.tsx", "src/components/Logo.tsx", "src/components/LogoColor.tsx", "src/components/LogoQueryGG.tsx", diff --git a/src/components/LibraryStatsSection.tsx b/src/components/LibraryStatsSection.tsx deleted file mode 100644 index b032e2bb5..000000000 --- a/src/components/LibraryStatsSection.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import { useQuery } from '@tanstack/react-query' -import { DownloadIcon, StarIcon } from '@phosphor-icons/react' -import type * as React from 'react' -import type { Library } from '~/libraries' -import { ossStatsQuery } from '~/queries/stats' - -interface LibraryStatsSectionProps { - library: Library -} - -function isValidMetric(value: number | undefined | null): value is number { - return ( - value !== undefined && value !== null && value > 0 && Number.isFinite(value) - ) -} - -function LibraryPlainStat({ - href, - icon, - label, - value, -}: { - href: string - icon: React.ReactNode - label: string - value: number | undefined -}) { - const hasValue = isValidMetric(value) - - return ( - - - {icon} - - - {hasValue ? value.toLocaleString() : '0'} - - - {label} - - - ) -} - -export function LibraryStatsSection({ library }: LibraryStatsSectionProps) { - const { data: stats } = useQuery(ossStatsQuery({ library })) - - return ( -
-
-
-
- ) -}