import { Tab } from "payload";

export const conditions: Tab = {
  name: 'conditions',
  interfaceName: 'conditionsSection',
  label: 'Conditions',
  fields: [
    {
      name: 'title',
      type: 'text',
      localized: true,
      label: 'Title',
      required: true,
    },
    {
      name: 'cards',
      type: 'array',
      label: 'Cards',
      required: true,
      interfaceName: 'conditionsItems',
      fields: [
        {
          name: 'conditionalName',
          type: 'text',
          localized: true,
          label: 'Conditional name',
          required: true,
        },
        {
          name: 'conditional',
          type: 'text',
          localized: true,
          label: 'Conditional',
          required: true,
        },
        {
          name: 'icon',
          type: 'upload',
          relationTo: 'media',
          label: 'Item icon',
          required: true,
        },
      ]
    },
  ]
}