Spaces:
Running
Running
File size: 768 Bytes
72f0edb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import React from "react";
import Carousel from "./Carousel";
import { Category } from "../lib/types";
import { useUrdfsByCategory } from "@/hooks/useUrdfData";
import { Skeleton } from "@/components/ui/skeleton";
interface ContentCarouselProps {
category: Category;
}
const ContentCarousel: React.FC<ContentCarouselProps> = ({ category }) => {
const { data: filteredItems, isLoading } = useUrdfsByCategory(category.id);
if (isLoading) {
return (
<div className="relative w-full">
<Skeleton className="h-64 w-full" />
</div>
);
}
return filteredItems.length > 0 ? (
<div className="relative w-full">
<Carousel title={category.name} items={filteredItems} />
</div>
) : null;
};
export default ContentCarousel;
|