This commit is contained in:
Blboun3 2024-05-14 16:42:19 +02:00
parent 0befb1f4f1
commit a8ec23e1e8
No known key found for this signature in database
2 changed files with 60 additions and 78 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,93 +1,75 @@
import { Button } from "../components/ui/button" import { Button } from "../components/ui/button";
import { import {
Card, Card,
CardContent, CardContent,
CardDescription, CardDescription,
CardFooter,
CardHeader, CardHeader,
CardTitle, CardTitle,
} from "../components/ui/card" } from "../components/ui/card";
import { import {
Tabs, Tabs,
TabsContent, TabsContent,
TabsList, TabsList,
TabsTrigger, TabsTrigger,
} from "../components/ui/tabs" } from "../components/ui/tabs";
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "../components/ui/carousel"
const data = [{ const data = [
{
value: "thisPage", value: "thisPage",
handle: "1", handle: "Projekt 1",
title: "This Page", title: "This Page",
description: "random text", description: "random text",
images: [{ src: "temp.jpg", alt: "text" }, { src: "temp.jpg", alt: "text2" }] images: [
}, { { src: "temp.jpg", alt: "text" },
{ src: "temp.jpg", alt: "text2" },
],
},
{
value: "thatPage", value: "thatPage",
title: "That Page", title: "That Page",
handle: "2", handle: "Projekt 2",
description: "random text", description: "random text",
images: [{ src: "temp.jpg", alt: "text" }, { src: "temp.jpg", alt: "text2" }] images: [
}, { { src: "temp.jpg", alt: "text" },
{ src: "temp.jpg", alt: "text2" },
],
},
{
value: "otherPge", value: "otherPge",
title: "Other Page", title: "Other Page",
handle: "3", handle: "Projekt 3",
description: "random text", description: "random text",
images: [{ src: "temp.jpg", alt: "text" }, { src: "temp.jpg", alt: "text2" }] images: [
}]; { src: "temp.jpg", alt: "text" },
{ src: "temp.jpg", alt: "text2" },
],
},
];
export function ShowcaseTabs() { export function ShowcaseTabs() {
return ( return (
<Tabs defaultValue={data[0].value} className="h-[87%] bottom-0 flex flex-col"> <Tabs
<div className="my-auto"> defaultValue={data[0].value}
<div> className="bottom-0 flex flex-col h-full my-auto"
{data.map((item) => ( >
<TabsContent value={item.value} className="">
<Card className="h-full">
<CardHeader>
<CardTitle>{item.title}</CardTitle>
<CardDescription>
{item.description}
</CardDescription>
</CardHeader>
<CardContent>
<Carousel className="w-full h-full" opts={{ align: "start", loop: "true" }}>
<CarouselContent>
{item.images.map((image, index) => (
<CarouselItem key={index}>
<Card>
<CardContent className="flex aspect-square items-center justify-center p-6">
<img src={image.src} alt={image.alt} />
</CardContent>
</Card>
</CarouselItem>
))}
</CarouselContent>
<div className="w-full pt-10 grid grid-cols-2 gap-4 ">
<div className="col-start-1 flex text-center justify-center w-full h-full">
<CarouselPrevious />
</div>
<div className="col-start-2 flex justify-center">
<CarouselNext />
</div>
</div>
</Carousel>
</CardContent>
</Card>
</TabsContent>
))}
<TabsList className={`grid w-full mt-4 grid-cols-${data.length}`}> <TabsList className={`grid w-full mt-4 grid-cols-${data.length}`}>
{data.map((item) => ( {data.map((item) => (
<TabsTrigger value={item.value}>{item.handle}</TabsTrigger> <TabsTrigger value={item.value}>{item.handle}</TabsTrigger>
))} ))}
</TabsList> </TabsList>
</div> {data.map((item) => (
</div> <TabsContent value={item.value} className="h-full">
<Card className="h-[90%] my-auto">
<CardHeader>
<CardTitle>{item.title}</CardTitle>
<CardDescription>{item.description}</CardDescription>
</CardHeader>
<CardContent>
<img src="/temp.jpg" alt="" />
</CardContent>
</Card>
</TabsContent>
))}
</Tabs> </Tabs>
) );
} }