Skip to content

Commit

Permalink
Homepge - default thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitjaininfo committed Oct 5, 2024
1 parent 9a6ebde commit 6b290cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/FeaturedCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { ArrowRightIcon } from "lucide-react";
import { Card, CardContent } from "@components/ui/card";
import { Button } from "./ui/button";

const PLACEHOLDER_IMAGES = ["/thumbnails/placeholder-1.png", "/thumbnails/placeholder-2.png"];

const FeaturedCarousel = ({ entries }: any) => {
return (
<Carousel
Expand All @@ -26,7 +28,7 @@ const FeaturedCarousel = ({ entries }: any) => {
<CarouselItem key={entry.id} className="lg:basis-1/3 sm:basis-1/2">
<Card className="h-full hover:shadow-md group shadow transition-all duration-300 mb-1 overflow-hidden">
<img
src={entry.data.Images[0]}
src={entry.data.Images && entry.data.Images.length > 0 ? entry.data.Images[0] : PLACEHOLDER_IMAGES[0]}
width={400}
height={500}
alt={entry.data.Name}
Expand Down

0 comments on commit 6b290cc

Please sign in to comment.