Skip to content

Commit 455464c

Browse files
ericyangpanclaude
andcommitted
refactor(ui): update page components to work with new GitHub stars data structure
Updates all product page components to be compatible with the new centralized GitHub stars data architecture. The components now receive stars data that has been looked up from the centralized storage by the data layer. Updated components: - AI Coding Landscape page - CLI detail and comparison pages - Extension detail and comparison pages - IDE detail and comparison pages 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6ad6a82 commit 455464c

File tree

7 files changed

+18
-10
lines changed

7 files changed

+18
-10
lines changed

src/app/[locale]/ai-coding-landscape/components/LandscapePage.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use client';
22

3-
import { Link } from '@/i18n/navigation';
43
import LandscapeViewTabs from './LandscapeViewTabs';
54
import { BackToNavigation } from '@/components/controls/BackToNavigation';
65
import type {

src/app/[locale]/clis/[slug]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { generateSoftwareDetailMetadata } from '@/lib/metadata';
1414
import type { Locale } from '@/i18n/config';
1515
import type { ManifestCLI, ManifestPricingTier, ComponentResourceUrls, ComponentCommunityUrls } from '@/types/manifests';
1616
import { clisData as clis } from '@/lib/generated';
17+
import { getGithubStars } from '@/lib/generated/github-stars';
1718

1819
export const revalidate = 3600;
1920

@@ -138,7 +139,7 @@ export default async function CLIPage({ params }: { params: Promise<{ locale: st
138139
categoryLabel={tHero('categories.CLI')}
139140
latestVersion={cli.latestVersion}
140141
license={cli.license}
141-
githubStars={cli.githubStars as number | null | undefined}
142+
githubStars={getGithubStars('clis', cli.id)}
142143
platforms={cli.platforms?.map(p => p.os)}
143144
websiteUrl={websiteUrl}
144145
docsUrl={docsUrl}

src/app/[locale]/clis/comparison/page.client.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import ComparisonTable, { type ComparisonColumn } from '@/components/ComparisonT
1111
import { formatPrice, type PricingTier } from '@/lib/pricing';
1212
import { renderLicense } from '@/lib/license';
1313
import { clisData as clis } from '@/lib/generated';
14+
import { getGithubStars } from '@/lib/generated/github-stars';
1415

1516
type Props = {
1617
locale: string;
@@ -101,8 +102,9 @@ export default function CLIComparisonPageClient({ locale }: Props) {
101102
{
102103
key: 'githubStars',
103104
label: tComparison('columns.githubStars'),
104-
render: (value: unknown, item: Record<string, unknown>) => {
105-
const stars = value as number | null;
105+
render: (_: unknown, item: Record<string, unknown>) => {
106+
const id = item.id as string;
107+
const stars = getGithubStars('clis', id);
106108
const communityUrls = item.communityUrls as {
107109
github?: string;
108110
} | undefined;

src/app/[locale]/extensions/[slug]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { generateSoftwareDetailMetadata } from '@/lib/metadata';
1313
import type { Locale } from '@/i18n/config';
1414
import type { ManifestExtension } from '@/types/manifests';
1515
import { extensionsData as extensions } from '@/lib/generated';
16+
import { getGithubStars } from '@/lib/generated/github-stars';
1617

1718
export const revalidate = 3600;
1819

@@ -126,7 +127,7 @@ export default async function ExtensionPage({ params }: { params: Promise<{ loca
126127
categoryLabel={tHero('categories.EXTENSION')}
127128
latestVersion={extension.latestVersion}
128129
license={extension.license}
129-
githubStars={extension.githubStars as number | null | undefined}
130+
githubStars={getGithubStars('extensions', extension.id)}
130131
additionalInfo={extension.supportedIdes && extension.supportedIdes.length > 0 ? [{
131132
label: tHero('supportedIdes'),
132133
value: extension.supportedIdes.map(ideSupport => ideSupport.ideId).join(', ')

src/app/[locale]/extensions/comparison/page.client.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import ComparisonTable, { type ComparisonColumn } from '@/components/ComparisonT
1010
import { formatPrice, type PricingTier } from '@/lib/pricing';
1111
import { renderLicense } from '@/lib/license';
1212
import { extensionsData as extensions } from '@/lib/generated';
13+
import { getGithubStars } from '@/lib/generated/github-stars';
1314

1415
type Props = {
1516
locale: string;
@@ -87,8 +88,9 @@ export default function ExtensionComparisonPageClient({ locale }: Props) {
8788
{
8889
key: 'githubStars',
8990
label: tComparison('columns.githubStars'),
90-
render: (value: unknown, item: Record<string, unknown>) => {
91-
const stars = value as number | null;
91+
render: (_: unknown, item: Record<string, unknown>) => {
92+
const id = item.id as string;
93+
const stars = getGithubStars('extensions', id);
9294
const communityUrls = item.communityUrls as {
9395
github?: string;
9496
} | undefined;

src/app/[locale]/ides/[slug]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { generateSoftwareDetailMetadata } from '@/lib/metadata';
1414
import type { Locale } from '@/i18n/config';
1515
import type { ManifestIDE, ManifestPricingTier, ComponentResourceUrls, ComponentCommunityUrls } from '@/types/manifests';
1616
import { idesData as ides } from '@/lib/generated';
17+
import { getGithubStars } from '@/lib/generated/github-stars';
1718

1819
export const revalidate = 3600;
1920

@@ -140,7 +141,7 @@ export default async function IDEPage({ params }: { params: Promise<{ locale: st
140141
categoryLabel={tHero('categories.IDE')}
141142
latestVersion={ide.latestVersion}
142143
license={ide.license}
143-
githubStars={ide.githubStars as number | null | undefined}
144+
githubStars={getGithubStars('ides', ide.id)}
144145
platforms={ide.platforms?.map(p => p.os)}
145146
websiteUrl={websiteUrl}
146147
docsUrl={docsUrl}

src/app/[locale]/ides/comparison/page.client.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import ComparisonTable, { type ComparisonColumn } from '@/components/ComparisonT
1111
import { formatPrice, type PricingTier } from '@/lib/pricing';
1212
import { renderLicense } from '@/lib/license';
1313
import { idesData as ides } from '@/lib/generated';
14+
import { getGithubStars } from '@/lib/generated/github-stars';
1415

1516
type Props = {
1617
locale: string;
@@ -100,8 +101,9 @@ export default function IDEComparisonPageClient({ locale }: Props) {
100101
{
101102
key: 'githubStars',
102103
label: tComparison('columns.githubStars'),
103-
render: (value: unknown, item: Record<string, unknown>) => {
104-
const stars = value as number | null;
104+
render: (_: unknown, item: Record<string, unknown>) => {
105+
const id = item.id as string;
106+
const stars = getGithubStars('ides', id);
105107
const communityUrls = item.communityUrls as {
106108
github?: string;
107109
} | undefined;

0 commit comments

Comments
 (0)