/*
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: {
    street_1: THREE.Mesh
    street_2: THREE.Mesh
    street_3: THREE.Mesh
  }
  materials: {
    sidewalk: THREE.MeshStandardMaterial
    cordon: THREE.MeshStandardMaterial
    asfalt: THREE.MeshStandardMaterial
  }
}

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

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

export default Model
