/*
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: {
    Cube008: THREE.Mesh
    ['Cube.008_1']: THREE.Mesh
    ['Cube.008_2']: THREE.Mesh
  }
  materials: {
    ['Mango.002']: THREE.MeshStandardMaterial
    ['Ojos.002']: THREE.MeshStandardMaterial
    ['marble.003']: THREE.MeshStandardMaterial
  }
}

export default function Model(props: JSX.IntrinsicElements['group']) {
  const group = useRef<THREE.Group>()
  const { nodes, materials } = useGLTF('/model/obras/mateo.glb') as GLTFResult
  return (
    <group ref={group} {...props} dispose={null}>
      <group>
        <mesh material={materials['Mango.002']} geometry={nodes.Cube008.geometry} />
        <mesh material={materials['Ojos.002']} geometry={nodes['Cube.008_1'].geometry} />
        <mesh
          material={materials['marble.003']}
          geometry={nodes['Cube.008_2'].geometry}
        />
      </group>
    </group>
  )
}

useGLTF.preload('/model/obras/mateo.glb')
