import PropTypes from 'prop-types';
import { RADIO } from '../../schemaComponentTypes';

export const LAYOUT_NO_IMG = 'noimg';
export const LAYOUT_DEFAULT = 'default';
export const LAYOUT_DETAILED = 'detailed';
export const LAYOUT_2COLUMNS = '2columns';

const VIEW_MODE_OPTIONS = [
    { value: LAYOUT_NO_IMG, label: 'uieditor.sfbComponent.productQuickview.viewMode.noimg' },
    { value: LAYOUT_DEFAULT, label: 'uieditor.sfbComponent.productQuickview.viewMode.default' },
    { value: LAYOUT_DETAILED, label: 'uieditor.sfbComponent.productQuickview.viewMode.detailed' },
    { value: LAYOUT_2COLUMNS, label: 'uieditor.sfbComponent.productQuickview.viewMode.2columns' }
];

export const productQuickviewSchemaForm = {
    quickviewViewMode: {
        type: RADIO,
        defaultValue: LAYOUT_DEFAULT,
        options: VIEW_MODE_OPTIONS,
        validation: {
            availableOptions: VIEW_MODE_OPTIONS.map(({ value }) => value),
            message: 'uieditor.sfbComponent.dropdown.validation.message',
            default: 'uieditor.sfbComponent.dropdown.defaultValue'
        }
    }
};


export const productQuickviewSettingsPropTypes = {
    quickviewViewMode: PropTypes.oneOf([LAYOUT_NO_IMG, LAYOUT_DEFAULT, LAYOUT_DETAILED, LAYOUT_2COLUMNS])
};
