samirhosninet commited on
Commit
deeff32
·
1 Parent(s): 06747cc

feat(comparison): reframe table as one key vs direct provider APIs

Browse files
Files changed (2) hide show
  1. components/comparison-table.tsx +81 -31
  2. lib/languages.ts +83 -50
components/comparison-table.tsx CHANGED
@@ -3,77 +3,110 @@
3
  import { Check, X } from "lucide-react";
4
  import { useLanguage } from "@/components/LanguageContext";
5
  import { translations } from "@/lib/languages";
 
6
 
7
  type TranslationKeys = keyof typeof translations.en;
8
 
 
 
9
  export function ComparisonTable() {
10
  const { t, language } = useLanguage();
11
 
12
- const rowIndices = [1, 2, 3, 4, 5, 6];
 
 
 
 
 
 
 
 
 
 
13
 
14
  return (
15
  <section className="relative z-10 w-full max-w-5xl mx-auto px-4 md:px-6 py-20 md:py-28">
16
- {/* Decorative top grid */}
17
  <div className="absolute top-0 left-1/2 -translate-x-1/2 w-full h-px bg-gradient-to-r from-transparent via-primary/20 to-transparent" />
18
 
19
- <div className="text-center space-y-5 mb-14">
20
- <div className="inline-flex items-center rounded-full border border-primary/20 bg-primary/5 px-4 py-1.5 text-sm font-medium text-primary backdrop-blur-sm shadow-sm">
21
  <span className="relative flex h-2 w-2 mr-2.5 rtl:mr-0 rtl:ml-2.5">
22
  <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"></span>
23
  <span className="relative inline-flex rounded-full h-2 w-2 bg-primary"></span>
24
  </span>
25
  {t("compBadge")}
26
  </div>
27
- <h2 className="text-3xl font-normal tracking-tight sm:text-5xl bg-clip-text text-transparent bg-gradient-to-br from-foreground via-foreground/90 to-muted-foreground pb-1">
28
- {t("compTitle")}<span className="font-display italic text-primary text-glow">{t("compTitleHighlighted")}</span>
29
  </h2>
30
- <p className="max-w-2xl mx-auto text-base text-muted-foreground font-mono text-sm">
31
- {t("compSubtitle")}
32
- </p>
 
 
 
 
 
33
  </div>
34
-
35
- {/* Mobile Scroll Swipe Indicator */}
36
- <div className="md:hidden flex justify-center items-center gap-1.5 text-[9px] text-muted-foreground/60 mb-3 font-mono uppercase tracking-widest animate-pulse select-none" aria-hidden="true">
37
- <span>{language === "ar" ? "← اسحب الجدول أفقياً للمزيد →" : "← Swipe table horizontally to see more →"}</span>
 
 
 
 
38
  </div>
39
 
40
- {/* Comparison Grid Table */}
41
  <div className="inverted-card w-full overflow-hidden border border-[var(--card-contrast-border)] rounded-2xl backdrop-blur-md shadow-[var(--menu-shadow)] transition-all duration-300">
42
  <div className="w-full overflow-x-auto">
43
  <table className="w-full border-collapse text-start font-mono text-xs md:text-sm">
44
  <thead>
45
  <tr className="border-b border-border bg-muted/50">
46
- <th scope="col" className="py-5 px-6 font-bold text-foreground uppercase tracking-wider text-start">{t("compThFeatures")}</th>
47
- <th scope="col" className="py-5 px-6 font-bold text-muted-foreground uppercase tracking-wider w-1/3 text-start">{t("compThDirect")}</th>
48
- <th scope="col" className="py-5 px-6 font-bold text-primary uppercase tracking-wider w-1/3 bg-primary/10 text-start">{t("compThHub")}</th>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  </tr>
50
  </thead>
51
  <tbody>
52
- {rowIndices.map((num, idx) => {
53
  const featureKey = `compRow${num}F` as TranslationKeys;
54
  const directKey = `compRow${num}Direct` as TranslationKeys;
55
  const hubKey = `compRow${num}Hub` as TranslationKeys;
56
 
57
- const feature = t(featureKey);
58
- const directText = t(directKey);
59
- const hubText = t(hubKey);
60
-
61
  return (
62
- <tr
63
  key={idx}
64
  className="border-b border-border hover:bg-primary/[0.03] transition-colors duration-200 group"
65
  >
66
- <td className="py-5 px-6 font-medium text-foreground group-hover:text-primary transition-colors duration-200 text-start">{feature}</td>
67
- <td className="py-5 px-6 text-muted-foreground tabular-nums text-start">
 
 
68
  <div className="flex items-center gap-2">
69
- <X className="h-4 w-4 text-rose-500/80 filter drop-shadow-[0_0_3px_rgba(244,63,94,0.4)] shrink-0" />
70
- <span>{directText}</span>
71
  </div>
72
  </td>
73
- <td className="py-5 px-6 text-foreground font-semibold bg-primary/[0.01] tabular-nums text-start">
74
  <div className="flex items-center gap-2">
75
- <Check className="h-4 w-4 text-primary shrink-0 filter drop-shadow-[0_0_6px_var(--primary-glow)]" />
76
- <span className="text-foreground">{hubText}</span>
77
  </div>
78
  </td>
79
  </tr>
@@ -83,7 +116,24 @@ export function ComparisonTable() {
83
  </table>
84
  </div>
85
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  </section>
87
  );
88
  }
89
-
 
3
  import { Check, X } from "lucide-react";
4
  import { useLanguage } from "@/components/LanguageContext";
5
  import { translations } from "@/lib/languages";
6
+ import { ShimmerButton } from "@/components/ui/shimmer-button";
7
 
8
  type TranslationKeys = keyof typeof translations.en;
9
 
10
+ const ROW_INDICES = [1, 2, 3, 4, 5, 6, 7, 8, 9] as const;
11
+
12
  export function ComparisonTable() {
13
  const { t, language } = useLanguage();
14
 
15
+ const scrollToWaitlist = () => {
16
+ const input = document.getElementById("email-input");
17
+ if (input) {
18
+ input.scrollIntoView({ behavior: "smooth", block: "center" });
19
+ setTimeout(() => input.focus(), 850);
20
+ }
21
+ };
22
+
23
+ const scrollToModels = () => {
24
+ document.getElementById("models")?.scrollIntoView({ behavior: "smooth", block: "start" });
25
+ };
26
 
27
  return (
28
  <section className="relative z-10 w-full max-w-5xl mx-auto px-4 md:px-6 py-20 md:py-28">
 
29
  <div className="absolute top-0 left-1/2 -translate-x-1/2 w-full h-px bg-gradient-to-r from-transparent via-primary/20 to-transparent" />
30
 
31
+ <div className="text-center space-y-5 mb-10 max-w-3xl mx-auto">
32
+ <div className="inline-flex items-center rounded-full border border-primary/20 bg-primary/5 px-4 py-1.5 text-sm font-medium text-primary backdrop-blur-sm shadow-sm font-mono tracking-widest uppercase">
33
  <span className="relative flex h-2 w-2 mr-2.5 rtl:mr-0 rtl:ml-2.5">
34
  <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"></span>
35
  <span className="relative inline-flex rounded-full h-2 w-2 bg-primary"></span>
36
  </span>
37
  {t("compBadge")}
38
  </div>
39
+ <h2 className="text-3xl font-extrabold tracking-tight sm:text-5xl text-foreground pb-1">
40
+ {t("compTitle")}
41
  </h2>
42
+ <div className="space-y-3 text-sm md:text-base text-muted-foreground font-mono text-start max-w-2xl mx-auto">
43
+ <p className="text-foreground/90 font-semibold">{t("compIntroLead")}</p>
44
+ <p>{t("compIntro1")}</p>
45
+ <p>{t("compIntro2")}</p>
46
+ <p>{t("compIntro3")}</p>
47
+ <p>{t("compIntroClosing")}</p>
48
+ <p className="text-foreground/90 font-medium pt-1">{t("compIntroSummary")}</p>
49
+ </div>
50
  </div>
51
+
52
+ <div
53
+ className="md:hidden flex justify-center items-center gap-1.5 text-[9px] text-muted-foreground/60 mb-3 font-mono uppercase tracking-widest animate-pulse select-none"
54
+ aria-hidden="true"
55
+ >
56
+ <span>
57
+ {language === "ar" ? "← اسحب الجدول أفقياً للمزيد →" : "← Swipe table horizontally to see more →"}
58
+ </span>
59
  </div>
60
 
 
61
  <div className="inverted-card w-full overflow-hidden border border-[var(--card-contrast-border)] rounded-2xl backdrop-blur-md shadow-[var(--menu-shadow)] transition-all duration-300">
62
  <div className="w-full overflow-x-auto">
63
  <table className="w-full border-collapse text-start font-mono text-xs md:text-sm">
64
  <thead>
65
  <tr className="border-b border-border bg-muted/50">
66
+ <th
67
+ scope="col"
68
+ className="py-5 px-6 font-bold text-foreground uppercase tracking-wider text-start"
69
+ >
70
+ {t("compThFeatures")}
71
+ </th>
72
+ <th
73
+ scope="col"
74
+ className="py-5 px-6 font-bold text-muted-foreground uppercase tracking-wider w-[34%] text-start"
75
+ >
76
+ {t("compThDirect")}
77
+ </th>
78
+ <th
79
+ scope="col"
80
+ className="py-5 px-6 font-bold text-primary uppercase tracking-wider w-[34%] bg-primary/10 text-start"
81
+ >
82
+ {t("compThHub")}
83
+ </th>
84
  </tr>
85
  </thead>
86
  <tbody>
87
+ {ROW_INDICES.map((num, idx) => {
88
  const featureKey = `compRow${num}F` as TranslationKeys;
89
  const directKey = `compRow${num}Direct` as TranslationKeys;
90
  const hubKey = `compRow${num}Hub` as TranslationKeys;
91
 
 
 
 
 
92
  return (
93
+ <tr
94
  key={idx}
95
  className="border-b border-border hover:bg-primary/[0.03] transition-colors duration-200 group"
96
  >
97
+ <td className="py-4 px-6 font-medium text-foreground group-hover:text-primary transition-colors duration-200 text-start">
98
+ {t(featureKey)}
99
+ </td>
100
+ <td className="py-4 px-6 text-muted-foreground text-start">
101
  <div className="flex items-center gap-2">
102
+ <X className="h-4 w-4 text-rose-500/80 shrink-0" aria-hidden />
103
+ <span>{t(directKey)}</span>
104
  </div>
105
  </td>
106
+ <td className="py-4 px-6 text-foreground font-semibold bg-primary/[0.01] text-start">
107
  <div className="flex items-center gap-2">
108
+ <Check className="h-4 w-4 text-primary shrink-0" aria-hidden />
109
+ <span>{t(hubKey)}</span>
110
  </div>
111
  </td>
112
  </tr>
 
116
  </table>
117
  </div>
118
  </div>
119
+
120
+ <div className="mt-10 flex flex-col sm:flex-row items-stretch sm:items-center justify-center gap-3">
121
+ <ShimmerButton
122
+ type="button"
123
+ onClick={scrollToWaitlist}
124
+ borderRadius="8px"
125
+ className="w-full sm:w-auto h-12 px-8 uppercase font-mono text-xs tracking-[0.2em] font-bold cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary"
126
+ >
127
+ <span className="relative z-10">{t("heroCtaGetKey")}</span>
128
+ </ShimmerButton>
129
+ <button
130
+ type="button"
131
+ onClick={scrollToModels}
132
+ className="w-full sm:w-auto h-12 px-8 uppercase font-mono text-xs tracking-[0.2em] font-bold cursor-pointer border border-border bg-secondary/20 dark:bg-white/5 hover:bg-primary/10 hover:border-primary/40 hover:text-primary transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary [clip-path:polygon(12px_0,100%_0,100%_calc(100%_-_12px),calc(100%_-_12px)_100%,0_100%,0_12px)]"
133
+ >
134
+ {t("heroCtaViewModels")}
135
+ </button>
136
+ </div>
137
  </section>
138
  );
139
  }
 
lib/languages.ts CHANGED
@@ -208,31 +208,48 @@ export const translations = {
208
  faqAccordion6A: "Under five minutes. Integration requires changing only two lines of code: redirecting your SDK base URL to the HUBAPI gateway and authenticating with your newly issued scoped key. No major code refactoring is needed.",
209
 
210
  // Comparison Table
211
- compBadge: "Technical Breakdown",
212
- compTitle: "HUBAPI vs. ",
213
- compTitleHighlighted: "Direct Provider Access",
214
- compSubtitle: "Why leading engineering teams transition from direct LLM API access to an intelligent gateway.",
215
- compThFeatures: "Features",
216
- compThDirect: "Direct LLM Calls",
217
- compThHub: "HUBAPI Gateway",
218
- compRow1F: "Multi-Model Intelligent Routing",
219
- compRow1Direct: "Manual switch logic",
220
- compRow1Hub: "AI-driven automatic optimal routing",
221
- compRow2F: "LLM Cost Savings",
222
- compRow2Direct: "0% (pay standard provider rates)",
223
- compRow2Hub: "Average 40% savings via compression & routing",
224
- compRow3F: "Failover & Fallback Redundancy",
225
- compRow3Direct: "Manual try-catch (minutes of downtime)",
226
- compRow3Hub: "Sub-millisecond secure cross-provider routing",
227
- compRow4F: "PII & Compliance Redaction",
228
- compRow4Direct: "Self-built regex/API layers",
229
- compRow4Hub: "Zero-trust built-in PII shield & audit compliance",
230
- compRow5F: "Observability & Latency Audits",
231
- compRow5Direct: "Fragmented logs across interfaces",
232
- compRow5Hub: "Visual timeline, token counts, & cost breakdowns",
233
- compRow6F: "Security & Fine-Grained API Keys",
234
- compRow6Direct: "Root developer keys shared",
235
- compRow6Hub: "Scoped keys with budget caps & time limits",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
 
237
  // FeatureJourneyMap — Why HUBAPI
238
  journeyBadge: "WHY_HUBAPI // MULTI_MODEL_CONTROL",
@@ -485,31 +502,47 @@ export const translations = {
485
  faqAccordion6A: "أقل من خمس دقائق. يتطلب الدمج تغيير سطرين فقط من الكود: إعادة توجيه عنوان URL الأساسي لـ SDK إلى بوابة HUBAPI والمصادقة باستخدام مفتاحك المحدد الجديد. لا يلزم إعادة هيكلة الكود بشكل كبير.",
486
 
487
  // Comparison Table
488
- compBadge: "التفاصيل التقنية الدقيقة",
489
- compTitle: "HUBAPI مقابل ",
490
- compTitleHighlighted: "الاتصال المباشر بالمزود",
491
- compSubtitle: "لماذا تنتقل فرق الهندسة الرائدة من الاتصال المباشر بـ APIs إلى البوابة الذكية.",
492
- compThFeatures: "الميزات والخصائص",
493
- compThDirect: "استدعاء الموديلات مباشرة",
494
- compThHub: "بوابة HUBAPI الذكية",
495
- compRow1F: "التوجيه الذكي متعدد الموديلات",
496
- compRow1Direct: "منطق تحويل يدوي في الكود",
497
- compRow1Hub: "توجيه تلقائي أمثل مدفوع بالذكاء الاصطناعي",
498
- compRow2F: "توفير تكاليف استهلاك الـ LLM",
499
- compRow2Direct: "0% (دفع الأسعار القياسية للمزود)",
500
- compRow2Hub: "توفير بمتوسط 40% عبر ضغط الطلبات والتوجيه",
501
- compRow3F: "دعم الاحتياط وتفادي الفشل الفوري",
502
- compRow3Direct: "��تل try-catch يدوية (دقائق من التعطل)",
503
- compRow3Hub: "توجيه آمن فوري بين المزودين في أجزاء من الملي ثانية",
504
- compRow4F: "تعتيم وحجب PII والامتثال للبيانات",
505
- compRow4Direct: "طبقات مخصصة وتعبيرات Regex مبنية ذاتياً",
506
- compRow4Hub: "درع مدمج لحماية PII مع ثقة صفرية وامتثال كامل",
507
- compRow5F: "الرصد المتقدم وتدقيق زمن الاستجابة",
508
- compRow5Direct: "سجلات مشتتة عبر واجهات متعددة",
509
- compRow5Hub: "مخطط زمني مرئي، أعداد التوكنز، وتفاصيل التكلفة",
510
- compRow6F: "أمان ومفاتيح API دقيقة الصلاحية",
511
- compRow6Direct: "مشاركة مفاتيح المطورين الرئيسية (Root)",
512
- compRow6Hub: "مفاتيح محددة الصلاحيات مع حدود الميزانية والوقت",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
513
 
514
  // FeatureJourneyMap — Why HUBAPI
515
  journeyBadge: "WHY_HUBAPI // تحكم_متعدد_النماذج",
 
208
  faqAccordion6A: "Under five minutes. Integration requires changing only two lines of code: redirecting your SDK base URL to the HUBAPI gateway and authenticating with your newly issued scoped key. No major code refactoring is needed.",
209
 
210
  // Comparison Table
211
+ compBadge: "COMPARISON // ONE_KEY_LAYER",
212
+ compTitle: "One HUBAPI Key vs. Direct Provider APIs",
213
+ compTitleHighlighted: "",
214
+ compIntroLead: "The more models you use, the more provider complexity you inherit.",
215
+ compIntro1: "Direct provider APIs are simple when you use one model.",
216
+ compIntro2:
217
+ "But modern AI products use many: OpenAI, Claude, Gemini, Mistral, Llama, DeepSeek, Qwen, Groq, and more.",
218
+ compIntro3:
219
+ "Every provider adds another API key, billing account, pricing table, rate limit, dashboard, and failure mode.",
220
+ compIntroClosing: "HUBAPI removes the operational mess between your app and the model ecosystem.",
221
+ compIntroSummary:
222
+ "HUBAPI gives you one API key, one balance, one dashboard, and one unified layer above every model.",
223
+ compThFeatures: "Feature",
224
+ compThDirect: "Direct Provider APIs",
225
+ compThHub: "HUBAPI",
226
+ compRow1F: "API Keys",
227
+ compRow1Direct: "One per provider",
228
+ compRow1Hub: "One HUBAPI key",
229
+ compRow2F: "Billing",
230
+ compRow2Direct: "Separate accounts",
231
+ compRow2Hub: "One balance",
232
+ compRow3F: "Models",
233
+ compRow3Direct: "Scattered",
234
+ compRow3Hub: "Unified catalog",
235
+ compRow4F: "SDK Setup",
236
+ compRow4Direct: "Provider-specific",
237
+ compRow4Hub: "OpenAI-compatible",
238
+ compRow5F: "Switching",
239
+ compRow5Direct: "Manual",
240
+ compRow5Hub: "One layer",
241
+ compRow6F: "Fallback",
242
+ compRow6Direct: "Custom code",
243
+ compRow6Hub: "Policy-based",
244
+ compRow7F: "Usage",
245
+ compRow7Direct: "Fragmented",
246
+ compRow7Hub: "One dashboard",
247
+ compRow8F: "Cost Control",
248
+ compRow8Direct: "Hard to compare",
249
+ compRow8Hub: "Model-level view",
250
+ compRow9F: "Team Access",
251
+ compRow9Direct: "Manual",
252
+ compRow9Hub: "Scoped keys",
253
 
254
  // FeatureJourneyMap — Why HUBAPI
255
  journeyBadge: "WHY_HUBAPI // MULTI_MODEL_CONTROL",
 
502
  faqAccordion6A: "أقل من خمس دقائق. يتطلب الدمج تغيير سطرين فقط من الكود: إعادة توجيه عنوان URL الأساسي لـ SDK إلى بوابة HUBAPI والمصادقة باستخدام مفتاحك المحدد الجديد. لا يلزم إعادة هيكلة الكود بشكل كبير.",
503
 
504
  // Comparison Table
505
+ compBadge: "COMPARISON // طبقة_مفتاح_واحد",
506
+ compTitle: "مفتاح HUBAPI واحد مقابل واجهات المزودين المباشرة",
507
+ compTitleHighlighted: "",
508
+ compIntroLead: "كلما استخدمت نماذج أكثر، زادت تعقيدات إدارة المزودين.",
509
+ compIntro1: "واجهات المزودين المباشرة بسيطة عندما تستخدم نموذجاً واحداً.",
510
+ compIntro2:
511
+ "لكن منتجات الذكاء الاصطناعي الحديثة تستخدم عدة نماذج: OpenAI وClaude وGemini وMistral وLlama وDeepSeek وQwen وGroq والمزيد.",
512
+ compIntro3:
513
+ "كل مزود يضيف مفتاح API آخر، وحساب فوترة، وجدول أسعار، وحد معدل، ولوحة تحكم، ونمط فشل.",
514
+ compIntroClosing: "HUBAPI يزيل الفوضى التشغيلية بين تطبيقك ونظام النماذج.",
515
+ compIntroSummary: "HUBAPI يمنحك مفتاح API واحد، ورصيداً واحداً، ولوحة تحكم واحدة، وطبقة موحدة فوق كل نموذج.",
516
+ compThFeatures: "الميزة",
517
+ compThDirect: "واجهات المزودين المباشرة",
518
+ compThHub: "HUBAPI",
519
+ compRow1F: "مفاتيح API",
520
+ compRow1Direct: "مفتاح لكل مزود",
521
+ compRow1Hub: "مفتاح HUBAPI واحد",
522
+ compRow2F: "الفوترة",
523
+ compRow2Direct: "حسابات منفصلة",
524
+ compRow2Hub: "رصيد واحد",
525
+ compRow3F: "النماذج",
526
+ compRow3Direct: "موزعة",
527
+ compRow3Hub: "كتالوج موحد",
528
+ compRow4F: "إعداد SDK",
529
+ compRow4Direct: "خاص بكل مزود",
530
+ compRow4Hub: "متوافق مع OpenAI",
531
+ compRow5F: "التبديل",
532
+ compRow5Direct: "يدوي",
533
+ compRow5Hub: "طبقة واحدة",
534
+ compRow6F: "التوجيه الاحتياطي",
535
+ compRow6Direct: "كود مخصص",
536
+ compRow6Hub: "سياسات جاهزة",
537
+ compRow7F: "الاستخدام",
538
+ compRow7Direct: "مشتت",
539
+ compRow7Hub: "لوحة واحدة",
540
+ compRow8F: "التحكم بالتكلفة",
541
+ compRow8Direct: "صعب المقارنة",
542
+ compRow8Hub: "رؤية على مستوى النموذج",
543
+ compRow9F: "وصول الفريق",
544
+ compRow9Direct: "يدوي",
545
+ compRow9Hub: "مفاتيح محددة النطاق",
546
 
547
  // FeatureJourneyMap — Why HUBAPI
548
  journeyBadge: "WHY_HUBAPI // تحكم_متعدد_النماذج",