text: import S from '@sanity/desk-tool/structure-builder'
  import React from 'react'
  
  import { BsFillPersonFill } from 'react-icons/bs'
  import { FiSettings } from 'react-icons/fi'
  import { FaMicroblog, FaHome, FaClipboardList, FaConnectdevelop } from 'react-icons/fa'
  import { ImProfile } from 'react-icons/im'
  import { MdComputer } from 'react-icons/md'
  
  const JsonPreview = ({ document }) => (
    <>
      <h1>JSON Data for "{document.displayed.title}"</h1>
      <pre>{JSON.stringify(document.displayed, null, 2)}</pre>
    </>
  )
  
  export const getDefaultDocumentNode = ({ documentId, schemaType }) => {
    // Render the JSON preview only on posts or the siteSettings document
  
    // if (schemaType === 'post' || documentId === 'siteSettings') {
    //   console.log({ documentId })
    return S.document().views([S.view.form(), S.view.component(JsonPreview).title('JSON')])
    // }
  }
  
  export default () =>
    S.list()
      .title('Admin Console')
      .items([
        S.listItem()
          .title('Blog')
          .icon(FaMicroblog)
          // This automatically gives it properties from the project type
          .schemaType('post')
          // When you open this list item, list out the documents
          // of the type “project"
          .child(S.documentTypeList('post').title('Posts')),
        S.listItem()
          .title('Theme')
          .icon(MdComputer)
          .child(S.document().schemaType('theme').documentId('theme').title('Theme')),
        S.divider(),
        S.listItem()
          .title('Home Page')
          .icon(FaHome)
          .child(S.document().schemaType('home').documentId('home').title('Home Page')),
        S.listItem()
          .title('Resume Page')
          .icon(ImProfile)
          .child(S.document().schemaType('resume').documentId('resume').title('Resume Data')),
        S.divider(),
  
        // Make a new list item
        S.listItem()
          // Give it a title
          .title('Resume Components')
          .icon(FaClipboardList)
          .child(
            // Make a list in the second pane called Portfolio
            S.list()
              .title('Resumes')
              .items([
                // Add the first list item
                S.listItem()
                  .title('Job History')
                  // This automatically gives it properties from the project type
                  .schemaType('job')
                  // When you open this list item, list out the documents
                  // of the type “project"
                  .child(S.documentTypeList('job').title('Jobs')),
                S.listItem()
                  .title('School')
                  .schemaType('education')
                  // When you open this list item, list out the documents
                  // of the type category"
                  .child(S.documentTypeList('education').title('Schools')),
                S.listItem()
                  .title('Activities & Involvement')
                  .schemaType('involvement')
                  // When you open this list item, list out the documents
                  // of the type category"
                  .child(S.documentTypeList('involvement').title('Activities & Involvements')),
                S.listItem()
                  .title('Topics')
                  .schemaType('language')
                  // When you open this list item, list out the documents
                  // of the type category"
                  .child(S.documentTypeList('language').title('Topics')),
              ])
          ),
  
        S.listItem()
          // Give it a title
          .title('Settings')
          .icon(FiSettings)
          .child(
            // Make a list in the second pane called Portfolio
            S.list()
              .title('Settings')
              .items([
                // Add the first list item
                S.listItem()
                  .title('My Information')
                  .icon(BsFillPersonFill)
                  .child(S.document().schemaType('author').documentId('author').title('Personal Information')),
                S.listItem()
                  .title('Social Networks')
                  .icon(FaConnectdevelop)
                  .child(S.document().schemaType('social').documentId('social').title('Social Networks')),
                S.listItem()
                  .title('Theme Presets')
                  .schemaType('themePreset')
                  // When you open this list item, list out the documents
                  // of the type category"
                  .child(S.documentTypeList('themePreset').title('Theme Presets')),
              ])
          ),
  
        ...S.documentTypeListItems().filter(
          (listItem) =>
            ![
              'siteSettings',
              'job',
              'category',
              'author',
              'education',
              'involvement',
              'language',
              'social',
              'home',
              'post',
              'theme',
              'resume',
              'themePreset',
            ].includes(listItem.getId())
        ),
      ])
  