@@ -36,6 +36,7 @@ export interface ProductHeroProps {
3636
3737 // Type (for Providers)
3838 type ?: string
39+ typeValue ?: string // Translated type value (e.g., "Foundation Model Provider")
3940
4041 // Links
4142 websiteUrl ?: string
@@ -50,21 +51,6 @@ export interface ProductHeroProps {
5051 url : string
5152 icon ?: string
5253 } [ ]
53-
54- // i18n labels
55- labels ?: {
56- vendor ?: string
57- version ?: string
58- license ?: string
59- stars ?: string
60- platforms ?: string
61- type ?: string
62- typeValue ?: string // Translated type value (e.g., "Foundation Model Provider")
63- visitWebsite ?: string
64- documentation ?: string
65- download ?: string
66- getApiKey ?: string
67- }
6854}
6955
7056export function ProductHero ( {
@@ -81,15 +67,16 @@ export function ProductHero({
8167 showAllPlatforms = false ,
8268 additionalInfo,
8369 type,
70+ typeValue,
8471 websiteUrl,
8572 githubUrl,
8673 docsUrl,
8774 downloadUrl,
8875 applyKeyUrl,
8976 additionalUrls,
90- labels = { } ,
9177} : ProductHeroProps ) {
92- const t = useTranslations ( )
78+ const t = useTranslations ( 'components.productHero' )
79+
9380 // Determine which platforms to display
9481 const displayPlatforms = platforms
9582 ? showAllPlatforms
@@ -129,7 +116,7 @@ export function ProductHero({
129116 < div className = "inline-flex items-center gap-[var(--spacing-sm)] flex-wrap px-[var(--spacing-md)] py-[var(--spacing-md)] border border-[var(--color-border)] text-sm" >
130117 { vendor && (
131118 < div className = "flex gap-1" >
132- < span className = "text-[var(--color-text-muted)]" > { labels . vendor || 'Vendor' } :</ span >
119+ < span className = "text-[var(--color-text-muted)]" > { t ( ' vendor' ) } :</ span >
133120 < span className = "font-medium" > { vendor } </ span >
134121 </ div >
135122 ) }
@@ -138,9 +125,7 @@ export function ProductHero({
138125
139126 { latestVersion && (
140127 < div className = "flex gap-1" >
141- < span className = "text-[var(--color-text-muted)]" >
142- { labels . version || 'Version' } :
143- </ span >
128+ < span className = "text-[var(--color-text-muted)]" > { t ( 'version' ) } :</ span >
144129 < span className = "font-medium" > { latestVersion } </ span >
145130 </ div >
146131 ) }
@@ -149,9 +134,7 @@ export function ProductHero({
149134
150135 { license && (
151136 < div className = "flex gap-1" >
152- < span className = "text-[var(--color-text-muted)]" >
153- { labels . license || 'License' } :
154- </ span >
137+ < span className = "text-[var(--color-text-muted)]" > { t ( 'license' ) } :</ span >
155138 { renderLicense (
156139 license ,
157140 '!font-medium hover:underline hover:decoration-dotted transition-colors underline-offset-2' ,
@@ -166,7 +149,7 @@ export function ProductHero({
166149
167150 { githubStars !== null && githubStars !== undefined && (
168151 < div className = "flex gap-1" >
169- < span className = "text-[var(--color-text-muted)]" > { labels . stars || 'Stars' } :</ span >
152+ < span className = "text-[var(--color-text-muted)]" > { t ( ' stars' ) } :</ span >
170153 < span className = "font-medium" > { githubStars } k</ span >
171154 </ div >
172155 ) }
@@ -208,7 +191,7 @@ export function ProductHero({
208191 < div className = "flex justify-center mb-[var(--spacing-lg)]" >
209192 < div className = "inline-flex items-center gap-[var(--spacing-xs)] px-[var(--spacing-md)] py-[var(--spacing-sm)] bg-[var(--color-hover)] border border-[var(--color-border)]" >
210193 < span className = "text-xs text-[var(--color-text-muted)] uppercase tracking-wider font-medium" >
211- { labels . platforms || 'Platforms' } :
194+ { t ( ' platforms' ) } :
212195 </ span >
213196 < div className = "flex gap-[var(--spacing-xs)] flex-wrap" >
214197 { ( [ 'macOS' , 'Windows' , 'Linux' ] as const ) . map ( platform => {
@@ -233,13 +216,13 @@ export function ProductHero({
233216 ) }
234217
235218 { /* Type (for providers) */ }
236- { type && labels ?. typeValue && (
219+ { type && typeValue && (
237220 < div className = "flex justify-center mb-[var(--spacing-lg)]" >
238221 < div className = "inline-flex items-center gap-[var(--spacing-xs)] px-[var(--spacing-md)] py-[var(--spacing-sm)] bg-[var(--color-hover)] border border-[var(--color-border)]" >
239222 < span className = "text-xs text-[var(--color-text-muted)] uppercase tracking-wider font-medium" >
240- { labels . type || 'Type' } :
223+ { t ( ' type' ) } :
241224 </ span >
242- < span className = "text-sm font-medium" > { labels . typeValue } </ span >
225+ < span className = "text-sm font-medium" > { type } </ span >
243226 </ div >
244227 </ div >
245228 ) }
@@ -253,7 +236,7 @@ export function ProductHero({
253236 rel = "noopener"
254237 className = "inline-flex items-center gap-[var(--spacing-xs)] px-[var(--spacing-md)] py-[var(--spacing-sm)] text-sm font-medium border border-[var(--color-border-strong)] bg-[var(--color-text)] text-[var(--color-bg)] hover:bg-[var(--color-text-secondary)] transition-all"
255238 >
256- < span > ↗</ span > { labels . visitWebsite || 'Visit Website' }
239+ < span > ↗</ span > { t ( ' visitWebsite' ) }
257240 </ a >
258241 ) }
259242
@@ -275,7 +258,7 @@ export function ProductHero({
275258 rel = "noopener"
276259 className = "inline-flex items-center gap-[var(--spacing-xs)] px-[var(--spacing-md)] py-[var(--spacing-sm)] text-sm font-medium border border-[var(--color-border-strong)] bg-transparent hover:bg-[var(--color-hover)] transition-all"
277260 >
278- < span > →</ span > { labels . documentation || 'Documentation' }
261+ < span > →</ span > { t ( ' documentation' ) }
279262 </ a >
280263 ) }
281264
@@ -286,7 +269,7 @@ export function ProductHero({
286269 rel = "noopener"
287270 className = "inline-flex items-center gap-[var(--spacing-xs)] px-[var(--spacing-md)] py-[var(--spacing-sm)] text-sm font-medium border border-[var(--color-border-strong)] bg-transparent hover:bg-[var(--color-hover)] transition-all"
288271 >
289- < span > ⬇</ span > { labels . download || 'Download' }
272+ < span > ⬇</ span > { t ( ' download' ) }
290273 </ a >
291274 ) }
292275
@@ -297,7 +280,7 @@ export function ProductHero({
297280 rel = "noopener"
298281 className = "inline-flex items-center gap-[var(--spacing-xs)] px-[var(--spacing-md)] py-[var(--spacing-sm)] text-sm font-medium border border-[var(--color-border-strong)] bg-transparent hover:bg-[var(--color-hover)] transition-all"
299282 >
300- < span > 🔑</ span > { labels . getApiKey || 'Get API Key' }
283+ < span > 🔑</ span > { t ( ' getApiKey' ) }
301284 </ a >
302285 ) }
303286
0 commit comments