import {defineField, defineType} from 'sanity'
import {YouTubePreview} from '../components/YouTubePreview'

export default defineType({
  name: 'youtube',
  title: 'YouTube',
  type: 'object',
  fields: [
    defineField({
      name: 'url',
      title: 'URL',
      type: 'url',
    }),
  ],
  preview: {
    select: {
      url: 'url',
    },
  },
  components: {
    preview: YouTubePreview,
  },
})
