/*
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: {
    Cube012: THREE.Mesh
    ['Cube.012_1']: THREE.Mesh
    ['Cube.012_2']: THREE.Mesh
  }
  materials: {
    ['wood.001']: THREE.MeshStandardMaterial
    ['stars.001']: THREE.MeshStandardMaterial
    black: THREE.MeshBasicMaterial
  }
}

export default function Model(props: JSX.IntrinsicElements['group']) {
  const group = useRef<THREE.Group>()
  const { nodes, materials } = useGLTF('/model/obras/julian.glb') as GLTFResult
  return (
    <group ref={group} {...props} dispose={null}>
      <group>
        <mesh material={materials['wood.001']} geometry={nodes.Cube012.geometry} />
        <mesh material={materials['stars.001']} geometry={nodes['Cube.012_1'].geometry} />
        <mesh material={materials.black} geometry={nodes['Cube.012_2'].geometry} />
      </group>
    </group>
  )
}

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