import { Tab } from "payload";

export const faqSection: Tab = {
  name: 'faq',
  interfaceName: 'FaqSection',
  label: 'FAQ',
  fields: [
    {
      name: 'title',
      type: 'text',
      localized: true,
      label: 'Title',
      required: true,
    },
    {
      name: 'subtitle',
      type: 'text',
      localized: true,
      label: 'Subtitle',
      required: true,
    },
    {
      name: 'items',
      type: 'array',
      label: 'Items',
      required: true,
      interfaceName: 'FaqItem',
      fields: [
        {
          name: 'question',
          type: 'text',
          localized: true,
          label: 'Question',
          required: true,
        },
        {
          name: 'answer',
          type: 'text',
          localized: true,
          label: 'Answer',
          required: true,
        }
      ]
    }
  ]
}
