1+ import { useTranslations } from 'next-intl'
12import { formatTokenCount } from '@/lib/format'
23import type { ManifestModel } from '@/types/manifests'
34
45export interface ModelSpecificationsProps {
56 model : Pick < ManifestModel , 'size' | 'contextWindow' | 'maxOutput' | 'tokenPricing' >
6- translations : {
7- title : string
8- modelSize : string
9- contextWindow : string
10- maxOutput : string
11- pricing : string
12- input : string
13- output : string
14- cache : string
15- }
167}
178
189/**
@@ -21,7 +12,8 @@ export interface ModelSpecificationsProps {
2112 * Displays technical specifications for AI models including size,
2213 * context window, max output, and token pricing.
2314 */
24- export function ModelSpecifications ( { model, translations } : ModelSpecificationsProps ) {
15+ export function ModelSpecifications ( { model } : ModelSpecificationsProps ) {
16+ const t = useTranslations ( 'components.modelSpecifications' )
2517 const hasContent =
2618 model . size ||
2719 model . contextWindow ||
@@ -38,22 +30,22 @@ export function ModelSpecifications({ model, translations }: ModelSpecifications
3830 < section className = "py-[var(--spacing-lg)] border-b border-[var(--color-border)]" >
3931 < div className = "max-w-8xl mx-auto px-[var(--spacing-md)]" >
4032 < h2 className = "text-2xl font-semibold tracking-[-0.02em] mb-[var(--spacing-sm)]" >
41- { translations . title }
33+ { t ( ' title' ) }
4234 </ h2 >
4335
4436 < div className = "grid grid-cols-1 md:grid-cols-2 gap-[var(--spacing-md)] mt-[var(--spacing-lg)]" >
4537 { model . size && (
4638 < div className = "border border-[var(--color-border)] p-[var(--spacing-md)]" >
4739 < h3 className = "text-xs text-[var(--color-text-muted)] uppercase tracking-wider font-medium mb-[var(--spacing-xs)]" >
48- { translations . modelSize }
40+ { t ( ' modelSize' ) }
4941 </ h3 >
5042 < p className = "text-lg font-semibold tracking-tight" > { model . size } </ p >
5143 </ div >
5244 ) }
5345
5446 < div className = "border border-[var(--color-border)] p-[var(--spacing-md)]" >
5547 < h3 className = "text-xs text-[var(--color-text-muted)] uppercase tracking-wider font-medium mb-[var(--spacing-xs)]" >
56- { translations . contextWindow }
48+ { t ( ' contextWindow' ) }
5749 </ h3 >
5850 < p className = "text-lg font-semibold tracking-tight" >
5951 { formatTokenCount ( model . contextWindow ) }
@@ -62,7 +54,7 @@ export function ModelSpecifications({ model, translations }: ModelSpecifications
6254
6355 < div className = "border border-[var(--color-border)] p-[var(--spacing-md)]" >
6456 < h3 className = "text-xs text-[var(--color-text-muted)] uppercase tracking-wider font-medium mb-[var(--spacing-xs)]" >
65- { translations . maxOutput }
57+ { t ( ' maxOutput' ) }
6658 </ h3 >
6759 < p className = "text-lg font-semibold tracking-tight" >
6860 { formatTokenCount ( model . maxOutput ) }
@@ -72,34 +64,28 @@ export function ModelSpecifications({ model, translations }: ModelSpecifications
7264 { model . tokenPricing && (
7365 < div className = "border border-[var(--color-border)] p-[var(--spacing-md)]" >
7466 < h3 className = "text-xs text-[var(--color-text-muted)] uppercase tracking-wider font-medium mb-[var(--spacing-xs)]" >
75- { translations . pricing }
67+ { t ( ' pricing' ) }
7668 </ h3 >
7769 < div className = "space-y-1" >
7870 { model . tokenPricing . input !== null && model . tokenPricing . input !== undefined && (
7971 < p className = "text-sm" >
80- < span className = "text-[var(--color-text-muted)] text-xs" >
81- { translations . input } { ' ' }
82- </ span >
72+ < span className = "text-[var(--color-text-muted)] text-xs" > { t ( 'input' ) } </ span >
8373 < span className = "font-semibold tracking-tight" >
8474 ${ model . tokenPricing . input } /M
8575 </ span >
8676 </ p >
8777 ) }
8878 { model . tokenPricing . output !== null && model . tokenPricing . output !== undefined && (
8979 < p className = "text-sm" >
90- < span className = "text-[var(--color-text-muted)] text-xs" >
91- { translations . output } { ' ' }
92- </ span >
80+ < span className = "text-[var(--color-text-muted)] text-xs" > { t ( 'output' ) } </ span >
9381 < span className = "font-semibold tracking-tight" >
9482 ${ model . tokenPricing . output } /M
9583 </ span >
9684 </ p >
9785 ) }
9886 { model . tokenPricing . cache !== null && model . tokenPricing . cache !== undefined && (
9987 < p className = "text-sm" >
100- < span className = "text-[var(--color-text-muted)] text-xs" >
101- { translations . cache } { ' ' }
102- </ span >
88+ < span className = "text-[var(--color-text-muted)] text-xs" > { t ( 'cache' ) } </ span >
10389 < span className = "font-semibold tracking-tight" >
10490 ${ model . tokenPricing . cache } /M
10591 </ span >
0 commit comments