import { Tab } from "payload";

export const rentalConditionals: Tab = {
  name: 'rentalConditionals',
  interfaceName: 'aboutUsRentalConditionals',
  label: 'Rental Conditionals',
  fields: [
    {
      name: 'title',
      type: 'text',
      localized: true,
      label: 'Title',
      required: true,
    },
    {
      name: 'leftPhoto',
      type: 'upload',
      relationTo: 'media',
      label: 'Left photo',
      required: true,
    },
    {
      name: 'rentalItems',
      type: 'array',
      label: 'Rental Items',
      required: true,
      interfaceName: 'rentalItems',
      fields: [
        {
          name: 'title',
          type: 'text',
          localized: true,
          label: 'Title',
          required: true,
        },
        {
          name: 'subtitle',
          type: 'text',
          localized: true,
          label: 'Subtitle',
          required: true
        },
        {
          name: 'caption',
          type: 'text',
          localized: true,
          label: 'Caption. Not required',
        },

        {
          name: 'icon',
          type: 'upload',
          relationTo: 'media',
          label: 'Item icon',
          required: true,
        }
      ]
    }
  ]
}