File size: 706 Bytes
f42b4a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
import React, { useEffect, useRef } from "react"
import { useLatentEngine } from "./useLatentEngine"
import { mockClap } from "@/lib/clap/mockClap"
import { Gsplat } from "../gsplat"

export type LatentEngineStatus =
  | "idle"
  | "loading"
  | "loaded"
  | "failed"

export function LatentEngine({
  url,
  width,
  height,
  className = "" }: {
  url: string
  width?: number
  height?: number
  className?: string
}) {
  const le = useLatentEngine()

  useEffect(() => {
    if (!le.loaded) {
      console.log("let's load an experience")
      le.load(mockClap())
    }
  }, [le.loaded])

  return (
    <div style={{ width, height }} className={className}>
      {/* <Gsplat /> */}
    </div>
  );
}