Skip to content

Commit 914e5d3

Browse files
committed
Change icons
1 parent c926899 commit 914e5d3

File tree

8 files changed

+107
-150
lines changed

8 files changed

+107
-150
lines changed

app/(inferenceai)/inferenceai/(rag-chatbot)/rag-chatbot/[lang]/data.tsx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ import {
3535
ragChatbotFaq2Answer,
3636
ragChatbotFaq3Answer
3737
} from "@/locales/.generated/server";
38+
import {
39+
ChatBubbleIcon,
40+
LockClosedIcon,
41+
ClockIcon,
42+
FileTextIcon,
43+
LayersIcon,
44+
Link2Icon,
45+
DashboardIcon,
46+
ReloadIcon
47+
} from "@radix-ui/react-icons";
3848

3949
export const nav = (lang: SupportedLanguage) => {
4050
const data = [
@@ -51,27 +61,27 @@ export const getKeyFeatures = (lang: SupportedLanguage) => {
5161
{
5262
title: ragChatbotKeyFeaturesFeatures0Title(lang),
5363
description: ragChatbotKeyFeaturesFeatures0Text(lang),
54-
icon: "/images/inferenceai/why-work-with-us/tailored-to-your-workflow.svg"
64+
icon: <FileTextIcon className="h-7 w-7 text-white" />
5565
},
5666
{
5767
title: ragChatbotKeyFeaturesFeatures1Title(lang),
5868
description: ragChatbotKeyFeaturesFeatures1Text(lang),
59-
icon: "/images/inferenceai/why-work-with-us/speed-to-launch.svg"
69+
icon: <ClockIcon className="h-7 w-7 text-white" />
6070
},
6171
{
6272
title: ragChatbotKeyFeaturesFeatures2Title(lang),
6373
description: ragChatbotKeyFeaturesFeatures2Text(lang),
64-
icon: "/images/inferenceai/why-work-with-us/ongoing-support-n-optimization.svg"
74+
icon: <LayersIcon className="h-7 w-7 text-white" />
6575
},
6676
{
6777
title: ragChatbotKeyFeaturesFeatures3Title(lang),
6878
description: ragChatbotKeyFeaturesFeatures3Text(lang),
69-
icon: "/images/inferenceai/why-work-with-us/speed-to-launch.svg"
79+
icon: <ChatBubbleIcon className="h-7 w-7 text-white" />
7080
},
7181
{
7282
title: ragChatbotKeyFeaturesFeatures4Title(lang),
7383
description: ragChatbotKeyFeaturesFeatures4Text(lang),
74-
icon: "/images/inferenceai/why-work-with-us/ongoing-support-n-optimization.svg"
84+
icon: <LockClosedIcon className="h-7 w-7 text-white" />
7585
}
7686
];
7787

@@ -82,23 +92,19 @@ export const getHowItWorks = (lang: SupportedLanguage) => {
8292
const data = [
8393
{
8494
title: ragChatbotHowItWorksSteps0Title(lang),
85-
description: ragChatbotHowItWorksSteps0Text(lang),
86-
image: "/images/inferenceai/how-it-works/discovery-n-strategy.png"
95+
description: ragChatbotHowItWorksSteps0Text(lang)
8796
},
8897
{
8998
title: ragChatbotHowItWorksSteps1Title(lang),
90-
description: ragChatbotHowItWorksSteps1Text(lang),
91-
image: "/images/inferenceai/how-it-works/agent-design-n-prototype.png"
99+
description: ragChatbotHowItWorksSteps1Text(lang)
92100
},
93101
{
94102
title: ragChatbotHowItWorksSteps2Title(lang),
95-
description: ragChatbotHowItWorksSteps2Text(lang),
96-
image: "/images/inferenceai/how-it-works/integration-n-deployment.png"
103+
description: ragChatbotHowItWorksSteps2Text(lang)
97104
},
98105
{
99106
title: ragChatbotHowItWorksSteps3Title(lang),
100-
description: ragChatbotHowItWorksSteps3Text(lang),
101-
image: "/images/inferenceai/how-it-works/training-n-iteration.png"
107+
description: ragChatbotHowItWorksSteps3Text(lang)
102108
}
103109
];
104110

@@ -109,19 +115,19 @@ export const getWhatIsIncluded = (lang: SupportedLanguage) => {
109115
const data = [
110116
{
111117
title: ragChatbotWhatIsIncludedItems0(lang),
112-
icon: "/images/inferenceai/what-you-get/end-to-end-strategy-session.svg"
118+
icon: <ChatBubbleIcon className="h-7 w-7 text-white" />
113119
},
114120
{
115121
title: ragChatbotWhatIsIncludedItems1(lang),
116-
icon: "/images/inferenceai/what-you-get/custom-ai-agent-architecture-n-design.svg"
122+
icon: <Link2Icon className="h-7 w-7 text-white" />
117123
},
118124
{
119125
title: ragChatbotWhatIsIncludedItems2(lang),
120-
icon: "/images/inferenceai/what-you-get/pompt-engineering-n-llm-integration.svg"
126+
icon: <DashboardIcon className="h-7 w-7 text-white" />
121127
},
122128
{
123129
title: ragChatbotWhatIsIncludedItems3(lang),
124-
icon: "/images/inferenceai/what-you-get/api-n-tool-integrations.svg"
130+
icon: <ReloadIcon className="h-7 w-7 text-white" />
125131
}
126132
];
127133

app/(inferenceai)/inferenceai/(rag-chatbot)/rag-chatbot/[lang]/home.tsx

Lines changed: 14 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -57,80 +57,25 @@ function KeyFeatures({ lang }: { lang: SupportedLanguage }) {
5757
}
5858

5959
function HowItWorks({ lang }: { lang: SupportedLanguage }) {
60-
const [activeIndex, setActiveIndex] = useState(0);
61-
6260
return (
6361
<GridItemsSection
6462
id="how-it-works"
6563
title={ragChatbotHowItWorksHeading(lang)}
6664
className="my-10 max-w-7xl">
6765
<div className="my-10" />
68-
<div className="md:hidden">
69-
<Accordion type="single" collapsible className="w-full">
70-
{getHowItWorks(lang).map((item, i) => (
71-
<AccordionItem key={i} value={`faq-${i}`} asChild>
72-
<Card className="my-4 w-full border-none bg-[#1B1728] shadow-sm transition-all duration-300">
73-
<CardHeader className="px-4 py-2">
74-
<AccordionTrigger className="flex items-center justify-between no-underline hover:no-underline focus:no-underline">
75-
<div className="flex flex-col">
76-
<div className="text-left text-xl font-medium text-white">
77-
{item.title}
78-
</div>
79-
<div className="text-left font-medium text-[#AFB0C3]">
80-
{item.description}
81-
</div>
82-
</div>
83-
</AccordionTrigger>
84-
</CardHeader>
85-
<AccordionContent asChild>
86-
<CardContent className="px-4 pb-4 pt-0 text-base text-[#CDCED8] lg:text-lg">
87-
<div className="relative aspect-[4/3] w-full overflow-hidden rounded-xl">
88-
<Image
89-
src={item.image}
90-
alt={item.title}
91-
fill
92-
className="object-contain"
93-
/>
94-
</div>
95-
</CardContent>
96-
</AccordionContent>
97-
</Card>
98-
</AccordionItem>
99-
))}
100-
</Accordion>
101-
</div>
102-
<div className="mx-auto mt-8 hidden w-full grid-cols-1 items-stretch gap-8 md:grid lg:grid-cols-2">
103-
<div className="h-full space-y-4">
104-
{getHowItWorks(lang).map((item, i) => (
105-
<Card
106-
key={i}
107-
onClick={() => setActiveIndex(i)}
108-
className={cn(
109-
"cursor-pointer rounded-2xl border bg-[#1B1728] p-4 transition-all duration-300 ease-in-out",
110-
i === activeIndex
111-
? "border-white/20 bg-[#2E2843] shadow-lg shadow-white/10 ring-1 ring-white/10"
112-
: "border-white/10"
113-
)}>
114-
<h3 className="mb-1 text-xl font-semibold text-white">
115-
{item.title}
116-
</h3>
117-
<p className="text-base text-[#AFB0C3] text-muted-foreground">
118-
{item.description}
119-
</p>
120-
</Card>
121-
))}
122-
</div>
123-
124-
<div className="flex min-h-[100%] items-center justify-center rounded-2xl bg-gradient-to-br from-[#2B2543] to-[#1A152E] p-8">
125-
<div className="relative aspect-[4/3] w-full max-w-md">
126-
<Image
127-
src={getHowItWorks(lang)[activeIndex].image}
128-
alt={getHowItWorks(lang)[activeIndex].title}
129-
fill
130-
className="rounded-xl object-contain transition duration-300"
131-
/>
132-
</div>
133-
</div>
66+
<div className="mt-8 w-full grid-cols-1 gap-8 space-y-6 md:grid md:space-y-0 lg:grid-cols-1">
67+
{getHowItWorks(lang).map((item, i) => (
68+
<Card
69+
key={i}
70+
className="group cursor-pointer rounded-2xl border border-white/10 bg-[#1B1728] p-6 transition-all duration-300 ease-in-out hover:border-white/20 hover:bg-gradient-to-br hover:from-[#2E2843] hover:to-[#1B1728] hover:shadow-lg hover:ring-1 hover:ring-white/10">
71+
<h3 className="mb-1 text-xl font-semibold text-white group-hover:text-white">
72+
{item.title}
73+
</h3>
74+
<p className="text-base text-[#AFB0C3] group-hover:text-[#CDCED8]">
75+
{item.description}
76+
</p>
77+
</Card>
78+
))}
13479
</div>
13580
</GridItemsSection>
13681
);
@@ -148,7 +93,7 @@ function WhatIsIncluded({ lang }: { lang: SupportedLanguage }) {
14893
key={idx}
14994
className="relative flex flex-col items-start justify-start gap-4 pl-6">
15095
<div className="absolute left-0 top-0 h-full w-[2px] bg-gradient-to-b from-transparent via-white/20 to-transparent" />
151-
<Image src={item.icon} alt={item.title} width={32} height={32} />
96+
{item.icon}
15297
<p className="text-base font-semibold text-white/90 md:text-xl">
15398
{item.title}
15499
</p>
Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,31 @@
11
"use client";
22

3-
import { cn } from "@/lib/utils";
43
import {
54
SupportedLanguage,
65
supportedLanguages
76
} from "@/locales/.generated/types";
8-
import Link from "next/link";
97

10-
export default function LanguagePicker({
11-
lang,
12-
isOpen
13-
}: {
14-
lang: SupportedLanguage;
15-
isOpen?: boolean;
16-
}) {
17-
return (
18-
<div className="flex gap-2">
19-
{supportedLanguages.map((l) => {
20-
const isActive = lang === l;
8+
const labelByLang: Record<SupportedLanguage, string> = {
9+
en: "🇬🇧 English",
10+
id: "🇮🇩 Indonesia"
11+
};
12+
13+
export default function LanguagePicker({ lang }: { lang: SupportedLanguage }) {
14+
const handleChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
15+
const newLang = e.target.value as SupportedLanguage;
16+
window.location.href = `/inferenceai/rag-chatbot/${newLang}#hero`;
17+
};
2118

22-
return (
23-
<Link
24-
scroll={false}
25-
key={l}
26-
href={`/inferenceai/rag-chatbot/${l}`}
27-
className={cn(
28-
"flex h-8 w-8 items-center justify-center rounded-full text-sm font-medium transition-colors",
29-
isActive
30-
? isOpen
31-
? "bg-inferenceai-indigo"
32-
: "text-white group-data-[scroll='false']:bg-white group-data-[scroll='true']:bg-inferenceai-indigo group-data-[scroll='false']:text-inferenceai-indigo group-data-[scroll='true']:text-white"
33-
: isOpen
34-
? "text-inferenceai-indigo"
35-
: "text-white group-data-[scroll='true']:text-inferenceai-indigo"
36-
)}>
37-
{l.toUpperCase()}
38-
</Link>
39-
);
40-
})}
41-
</div>
19+
return (
20+
<select
21+
value={lang}
22+
onChange={handleChange}
23+
className="rounded-full border bg-transparent px-3 py-2 text-sm font-medium text-white">
24+
{supportedLanguages.map((l) => (
25+
<option key={l} value={l}>
26+
{labelByLang[l]}
27+
</option>
28+
))}
29+
</select>
4230
);
4331
}

app/(inferenceai)/inferenceai/(rag-chatbot)/rag-chatbot/components/footer.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import data from "@/data.json";
33
import { Separator } from "@/components/ui/separator";
44
import { SupportedLanguage } from "@/locales/.generated/types";
55
import { inferenceaiFooter } from "@/locales/.generated/server";
6+
import LanguagePicker from "../[lang]/language-picker";
67

78
export default function Footer({ lang }: { lang: SupportedLanguage }) {
89
const { aiSocials, copyright } = data;
@@ -47,6 +48,8 @@ export default function Footer({ lang }: { lang: SupportedLanguage }) {
4748
))}
4849
</div>
4950

51+
<LanguagePicker lang={lang} />
52+
5053
<Separator className="w-full bg-[#29223E]" />
5154

5255
<p className="text-center text-sm">{copyright}</p>

app/(inferenceai)/inferenceai/(rag-chatbot)/rag-chatbot/components/hero.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import {
1111

1212
export default function Hero({ lang }: { lang: SupportedLanguage }) {
1313
return (
14-
<section className="relative overflow-hidden bg-[#04040B] text-white">
14+
<section
15+
id="hero"
16+
className="relative overflow-hidden bg-[#04040B] text-white">
1517
<motion.div
1618
initial={{ scale: 1.1 }}
1719
animate={{ scale: 1 }}

app/components/grid-items.tsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ import { cn } from "@/lib/utils";
1414
import Image from "next/image";
1515
import Link from "next/link";
1616
import { motion } from "framer-motion";
17-
import { Children, isValidElement, useEffect, useRef, useState } from "react";
17+
import React, {
18+
Children,
19+
isValidElement,
20+
useEffect,
21+
useRef,
22+
useState
23+
} from "react";
1824
import { GitFork, Star } from "lucide-react";
1925
import { SupportedLanguage } from "@/locales/.generated/types";
2026
import { mainSeeLess, mainSeeMore } from "@/locales/.generated/server";
@@ -77,7 +83,7 @@ type Item = {
7783
description: string;
7884
url?: string;
7985
category?: string;
80-
icon?: string;
86+
icon?: string | React.ReactElement;
8187
button?: boolean;
8288
repo?: string;
8389
};
@@ -184,7 +190,8 @@ export function GridItems({
184190
{items.map((item, idx) => {
185191
const { image, title, description, url, category, icon, button } = item;
186192
const stats = repoStats[idx] || { stars: 0, forks: 0 };
187-
193+
const isReactIcon = isValidElement(icon);
194+
const isStringIcon = typeof icon === "string";
188195
return (
189196
<CardWrapper
190197
key={idx}
@@ -205,9 +212,15 @@ export function GridItems({
205212
)}
206213

207214
<CardHeader>
208-
{icon && (
215+
{isReactIcon && (
216+
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-gradient-to-br from-[#2E2B3F] to-white/20 shadow-md">
217+
{icon}
218+
</div>
219+
)}
220+
221+
{isStringIcon && (
209222
<Avatar className="mb-6 h-14 w-14">
210-
<AvatarImage src={icon} alt={title} />
223+
<AvatarImage src={icon as string} alt={title} />
211224
</Avatar>
212225
)}
213226
{category && (

locales/en/rag-chatbot.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"1": {
2020
"title": "Real-Time Information Retrieval",
21-
"text": "Pulls the latest data from your selected sources, ensuring responses stay relevant."
21+
"text": "Pulls the latest data from your selected sources, ensuring responses stay relevant Customizable Knowledge Base: Connects with your cloud storage, collaboration tools, databases, APIs, and internal wikis for tailored insights"
2222
},
2323
"2": {
2424
"title": "Customizable Knowledge Base",
@@ -43,7 +43,7 @@
4343
},
4444
"1": {
4545
"title": "Fine-Tune Your Bot",
46-
"text": "Set retrieval rules, add instructions, and tailor responses to your needs."
46+
"text": "Set retrieval rules, add custom instructions, and refine responses."
4747
},
4848
"2": {
4949
"title": "Deploy & Test",

0 commit comments

Comments
 (0)