diff --git a/knip.jsonc b/knip.jsonc index 8f3933c21..b9180c135 100644 --- a/knip.jsonc +++ b/knip.jsonc @@ -33,7 +33,6 @@ "src/components/Gam.tsx", "src/components/LandingCommunitySection.tsx", "src/components/LandingPageGad.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 ( -
-
-
-
- ) -}