import type { CollectionConfig } from "payload";

export const Categories: CollectionConfig = {
  slug: "categories",
  access: { read: () => true },
  admin: { useAsTitle: "name", defaultColumns: ["name", "slug", "accent"] },
  fields: [
    { name: "name", type: "text", required: true },
    { name: "slug", type: "text", required: true, unique: true, index: true },
    {
      name: "accent",
      type: "select",
      defaultValue: "primary",
      options: [
        { label: "Primary (cyan)", value: "primary" },
        { label: "Secondary (magenta)", value: "secondary" },
        { label: "Tertiary (green)", value: "tertiary" },
      ],
    },
  ],
};
