/*
Auto-generated by: https://github.com/pmndrs/gltfjsx
*/

import * as THREE from 'three'
import React, { useRef } from 'react'
import { useGLTF } from '@react-three/drei/useGLTF'

import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader'

type GLTFResult = GLTF & {
  nodes: {
    Cube009: THREE.Mesh
    ['Cube.009_1']: THREE.Mesh
    ['Cube.009_2']: THREE.Mesh
    ['Cube.009_3']: THREE.Mesh
    ['Cube.009_4']: THREE.Mesh
  }
  materials: {
    marble: THREE.MeshStandardMaterial
    black: THREE.MeshStandardMaterial
    metal_glass: THREE.MeshStandardMaterial
    sidewalk: THREE.MeshStandardMaterial
    green_metal: THREE.MeshStandardMaterial
  }
}

export default function Model(props: JSX.IntrinsicElements['group']) {
  const group = useRef<THREE.Group>()
  const { scene } = useGLTF('/model/entrance.glb') as GLTFResult
  return (
    <group ref={group} {...props} dispose={null}>
      <primitive object={scene} dispose={null} matrixAutoUpdate={false} />
    </group>
  )
}

useGLTF.preload('/model/entrance.glb')
