import React, { Suspense } from "react"; import { FilledStarsIconSmall } from "../../components/icons/marketPlaceIcons"; import { Canvas } from "@react-three/fiber"; import { ContactShadows, OrbitControls, Text } from "@react-three/drei"; import GltfLoader from "./GltfLoader"; import * as THREE from "three"; // Define the shape of the selected card interface SelectedCard { assetName: string; uploadedOn: number; price: number; rating: number; views: number; description: string; AssetID: string; } // Define the props type for AssetPreview interface AssetPreviewProps { selectedCard: SelectedCard; modelUrl: string; setSelectedCard: React.Dispatch>; // Type for setter function } const savedTheme: string | null = localStorage.getItem("theme"); function Ui() { return ( Loading preview... ); } const AssetPreview: React.FC = ({ selectedCard, setSelectedCard, modelUrl, }) => { return (
{/* */} {/* Add canvas here */}
{ scene.background = new THREE.Color( savedTheme === "dark" ? 0x19191d : 0xfcfdfd ); }} > }> {selectedCard.assetName && modelUrl && ( )}
H
HERX FACTORY
Follow +
{/* asset details */}
{selectedCard.assetName}
{`${selectedCard.description}`}
{selectedCard.rating}
{selectedCard.views} views
₹ {selectedCard.price}
{/* buttons */}
Add to cart
Buy now
{/* close button */}
); }; export default AssetPreview;