import { defineConfig } from "sanity";
import { structureTool } from "sanity/structure";
import { visionTool } from "@sanity/vision";
import { schemaTypes } from "./schemas";

export default defineConfig({
  name: "kitafreunde-regenbogen",
  title: "Kitafreunde Regenbogen",

  projectId: process.env.SANITY_STUDIO_PROJECT_ID!,
  dataset: process.env.SANITY_STUDIO_DATASET ?? "production",

  plugins: [
    structureTool({
      structure: (S) =>
        S.list()
          .title("Inhalt")
          .items([
            S.documentTypeListItem("post").title("Aktuelles / Blog"),
            S.documentTypeListItem("project").title("Projekte"),
            S.documentTypeListItem("teamMember").title("Vorstand"),
            S.divider(),
            S.documentTypeListItem("siteSettings").title("Website-Einstellungen"),
          ]),
    }),
    visionTool(),
  ],

  schema: { types: schemaTypes },
});
