import { CHECKBOX, DROPDOWN } from '../../schemaComponentTypes';
import { DISPLAY_OPTIONS, VIEW_MODE_OPTIONS } from '../product-quickview';

export const productQuickviewSchemaForm = {
    quickviewDisplayOptions: {
        type: CHECKBOX,
        required: false,
        defaultValue: [DISPLAY_OPTIONS[0].value],
        options: DISPLAY_OPTIONS,
        conditionalAttributes: {
            isDisabled: {
                when: 'quickviewOptions',
                connector: 'notInclude',
                value: 'isQuickviewVisible'
            }
        },
        validation: {
            availableOptions: DISPLAY_OPTIONS.map(({ value }) => value),
            message: 'uieditor.sfbComponent.checkbox.validation.message'
        },
        indentSize: 1
    },
    quickviewViewMode: {
        title: 'uieditor.sfbComponent.productQuickview.quickviewViewMode.title',
        type: DROPDOWN,
        defaultValue: VIEW_MODE_OPTIONS[0].value,
        options: VIEW_MODE_OPTIONS,
        validation: {
            availableOptions: VIEW_MODE_OPTIONS.map(({ value }) => value),
            message: 'uieditor.sfbComponent.dropdown.validation.message',
            default: 'uieditor.sfbComponent.dropdown.defaultValue'
        }
    }
};
