
type ConfigureAction =
    | { type: 'addConfigure', payload: VixonicData }


export const anniversaryReducer = (state: VixonicData, action: ConfigureAction) => {

    const { downloadsPath, parameters } = action.payload
    switch (action.type) {
        case 'addConfigure':
            return {
                downloadsPath: downloadsPath,
                parameters: {
                    abbreviatedMonths: parameters.abbreviatedMonths,
                    animationMode: parameters.animationMode,
                    animationOrder: parameters.animationOrder,
                    animationSpeed: parameters.animationSpeed,
                    animationTime: parameters.animationTime,
                    apiDomain: parameters.apiDomain,
                    backgroundImage: parameters.backgroundImage,
                    containerColumns: parameters.containerColumns,
                    containerColumnsGap:parameters.containerColumnsGap,
                    containerRows: parameters.containerRows,
                    containerRowsGap: parameters.containerRowsGap,
                    dataMode: parameters.dataMode,
                    dateAlignment: parameters.dateAlignment,
                    dateDayFormat: parameters.dateDayFormat,
                    dateEnabled: parameters.dateEnabled,
                    dateMonthFormat: parameters.dateMonthFormat,
                    datePosition: parameters.datePosition,
                    datePrimaryColor: parameters.datePrimaryColor,
                    dateStyle: parameters.dateStyle,
                    descriptionEnabled: parameters.descriptionEnabled,
                    descriptionFormat: parameters.descriptionFormat,
                    optionalEnabled: parameters.optionalEnabled,
                    optionalFormat: parameters.optionalFormat,
                    excludePast: parameters.excludePast,
                    imageAlignment: parameters.imageAlignment,
                    imageEnabled: parameters.imageEnabled,
                    imagePosition: parameters.imagePosition,
                    imageSize: parameters.imageSize,
                    imageStyle: parameters.imageStyle,
                    itemMargins: parameters.itemMargins,
                    msj0: parameters.msj0,
                    nameFormat: parameters.nameFormat,
                    orientation: parameters.orientation,
                    padding: parameters.padding,
                    photosMode: parameters.photosMode,
                    photosZip: parameters.photosZip,
                    template: parameters.template,
                    textAlignment: parameters.textAlignment,
                    textPosition: parameters.textPosition,
                    updateTime: parameters.updateTime,
                    urlBaseApi: parameters.urlBaseApi,
                    imageMargin: parameters.imageMargin,
                    textMargin: parameters.textMargin,
                    dateMargin: parameters.dateMargin,
                    separator: parameters.separator,
                    nameMaxChar: parameters.nameMaxChar,
                    descriptionMaxChar: parameters.descriptionMaxChar    
                }
            }
        default:
            return state;
    }

}