import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from "../components/ui/card";
import {
  Tabs,
  TabsContent,
  TabsList,
  TabsTrigger,
} from "../components/ui/tabs";

import { dictionary } from "../i18n/dictionary";


export function ShowcaseTabs({ currentLocale }) {
  const { showcase } = dictionary[currentLocale];
  return (
    <Tabs
      defaultValue={showcase[0].value}
      className="bottom-0 flex flex-col h-full my-auto"
    >
      <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>
      {showcase.map((item) => (
        <TabsContent value={item.value} className="h-full" key={item.value}>
          <Card className="h-[90%] my-auto">
            <CardHeader>
              <CardTitle>{item.title}</CardTitle>
              <CardDescription>
                <span className="text-pretty">{item.description}</span>
              </CardDescription>
            </CardHeader>
            <CardContent className="h-[85%] w-full">
              <div className="h-full w-full">
                <img
                  src={item.image}
                  alt={item.imageAlt}
                  className="object-cover h-full w-full rounded-lg  "
                />
              </div>
            </CardContent>
          </Card>
        </TabsContent>
      ))}
    </Tabs>
  );
}
