import { defineConfig } from 'sanity'
import { structureTool } from 'sanity/structure'
import { schemaTypes } from './schemas'

export default defineConfig({
  name: 'rebours',
  title: 'REBOURS Studio',

  projectId: 'y821x5qu',
  dataset: 'production',

  plugins: [
    structureTool({
      structure: (S) =>
        S.list()
          .title('Contenu')
          .items([
            S.listItem()
              .title('Page d\'accueil')
              .id('homePage')
              .child(
                S.document()
                  .schemaType('homePage')
                  .documentId('homePage')
                  .title('Page d\'accueil')
              ),
            S.divider(),
            S.documentTypeListItem('product').title('Produits'),
          ]),
    }),
  ],
  schema: { types: schemaTypes },
})
