import type { CollectionConfig } from "payload";

export const Gear: CollectionConfig = {
  slug: "gear",
  access: { read: () => true },
  admin: {
    useAsTitle: "name",
    defaultColumns: ["name", "category", "featured"],
    group: "Content",
  },
  fields: [
    { name: "name", type: "text", required: true },
    {
      name: "category",
      type: "select",
      options: [
        { label: "Compute", value: "compute" },
        { label: "Audio", value: "audio" },
        { label: "Peripherals", value: "peripherals" },
        { label: "Network", value: "network" },
        { label: "Dev Tools", value: "dev-tools" },
        { label: "Other", value: "other" },
      ],
    },
    { name: "summary", type: "textarea" },
    { name: "link", type: "text" },
    { name: "image", type: "upload", relationTo: "media" },
    { name: "featured", type: "checkbox", defaultValue: false },
  ],
};
