/*
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: {
    Sphere001: THREE.Mesh
    ['Sphere.001_1']: THREE.Mesh
  }
  materials: {
    ['sphere_inner.001']: THREE.MeshStandardMaterial
    ['sphere_outer.001']: THREE.MeshStandardMaterial
  }
}

export default function Model(props: JSX.IntrinsicElements['group']) {
  const group = useRef<THREE.Group>()
  const { nodes, materials } = useGLTF('/model/obras/carolina.glb') as GLTFResult
  return (
    <group ref={group} {...props} dispose={null}>
      <group>
        <mesh
          material={materials['sphere_inner.001']}
          geometry={nodes.Sphere001.geometry}
        />
        <mesh
          material={materials['sphere_outer.001']}
          geometry={nodes['Sphere.001_1'].geometry}
        />
      </group>
    </group>
  )
}

useGLTF.preload('/mode/obras/carolina.glb')
