import EnterpriseSelect from '../../components/shared/EnterpriseSelect.vue'

export default {
  name: 'MailSettingsPanel',
  components: {
    EnterpriseSelect
  },
  props: {
    mailForm: {
      type: Object,
      required: true
    }
  },
  setup(props) {
    const encryptionOptions = [
      { label: 'SSL/TLS', value: 'SSL/TLS' },
      { label: 'STARTTLS', value: 'STARTTLS' },
      { label: '无', value: 'None' }
    ]

    function toggleField(field) {
      if (props.mailForm) {
        props.mailForm[field] = !props.mailForm[field]
      }
    }

    return {
      encryptionOptions,
      toggleField
    }
  }
}
