import type { CollectionConfig } from "payload"; import { Menu } from "../groups/Menu"; export const MenuItem: CollectionConfig = { slug: "menu-item", access: { read: () => true, }, admin: { useAsTitle: "name", group: Menu, }, fields: [ { name: "name", type: "text", required: true, localized: true, }, { name: "description", type: "richText", localized: true, }, { name: "image", type: "relationship", relationTo: "media", }, { name: "category", type: "relationship", relationTo: "menu-category", }, { name: "tags", type: "relationship", relationTo: "menu-item-tag", hasMany: true, }, { name: "variants", type: "array", minRows: 1, required: true, fields: [ { name: "title", type: "text", }, { name: "price", type: "number", required: true, }, ], }, ], };