import React from "react"; import Header from "../components/Header"; import Carousel from "../components/Carousel"; import { ContentItem } from "../lib/types"; import ChatWindow from "../components/ChatWindow"; import { useUrdfs, useCategories } from "@/hooks/useUrdfData"; import { Skeleton } from "@/components/ui/skeleton"; const Explore: React.FC = () => { const { data: urdfs, isLoading: isLoadingUrdfs } = useUrdfs(); const { data: categories, isLoading: isLoadingCategories } = useCategories(); // Group content items by categories const categorizedContent = React.useMemo(() => { if (!urdfs) return {}; return urdfs.reduce((acc, item) => { item.categories.forEach((category) => { if (!acc[category]) { acc[category] = []; } acc[category].push(item); }); return acc; }, {} as Record); }, [urdfs]); // Get unique categories const uniqueCategories = Object.keys(categorizedContent).sort(); return (
{/* Cosmic background wrapper */}
{/* Cosmic background with stars */}
{/* Subtle animated gradient overlay */}
{/* Random stars */}
{/* Main content area */}
{/* Page title */}

Explore All Robots

Browse our complete collection of robotics systems and deployable URDF units

{/* Chat window right below the title */}
{/* Content sections */}
{isLoadingUrdfs || isLoadingCategories ? ( // Loading skeleton
{[1, 2, 3].map((i) => (
{[1, 2, 3, 4].map((j) => ( ))}
))}
) : (
{uniqueCategories.map((category) => (

{category}

))}
)}
); }; export default Explore;