i18n integration for showcase

Moved showcase carousel data source to respective i18n/ language files
This commit is contained in:
Blboun3
2024-05-28 12:21:34 +02:00
parent 0c2600a7f6
commit 986ea7ef3f
7 changed files with 137 additions and 41 deletions

View File

@ -8,6 +8,6 @@ const { title, description } = dictionary[Astro.currentLocale];
<SinglePage>
<div class="flex flex-col h-screen">
<ShowcaseTabs client:load />
<ShowcaseTabs currentLocale={Astro.currentLocale} client:load />
</div>
</SinglePage>

View File

@ -12,20 +12,22 @@ import {
TabsTrigger,
} from "../components/ui/tabs";
import { data } from "../content/showcase";
import { dictionary } from "../i18n/dictionary";
export function ShowcaseTabs() {
export function ShowcaseTabs({ currentLocale }) {
const { showcase } = dictionary[currentLocale];
return (
<Tabs
defaultValue={data[0].value}
defaultValue={showcase[0].value}
className="bottom-0 flex flex-col h-full my-auto"
>
<TabsList className={`grid w-full mt-4 grid-cols-${data.length}`}>
{data.map((item) => (
<TabsList className={`grid w-full mt-4 grid-cols-${showcase.length}`}>
{showcase.map((item) => (
<TabsTrigger value={item.value} key={item.value}>{item.handle}</TabsTrigger>
))}
</TabsList>
{data.map((item) => (
{showcase.map((item) => (
<TabsContent value={item.value} className="h-full" key={item.value}>
<Card className="h-[90%] my-auto">
<CardHeader>