import * as constants from 'constants/CourseConstants';

var ServerActionCreators = require('../actions/ServerActionCreators');

const learningCardState={
  learningCards : [{
    "askUsSetId": null,
    "frontLCDetails": {
      "learningCardDetails": {
        "multimediaType": "text",
        "multimediaThumbnailURL": "",
        "lcMultimedia": "",
        "lcContentType": "EnglishPattern",
        "lcStatus": "COMPLETED",
        "lcMaximumPoints": 10,
        "t2sURL": "",
        "lcName": "",
        "lcId": 64911,
        "lcPoints": 10,
        "askUsSetId": null,
        "lcContent": "images/type/NEG.png|||images/NO_IMAGE.png|||images/NO_IMAGE.png|||-|||-|||Types of Sentences|||Negative|||"
      },
      "cardType": "CARD",
      "questionDetails": null
    },
    "lcStatus": "NOT_COMPLETED",
    "lcMaximumPoints": 10,
    "lcId": 64911,
    "lcPoints": 10,
    "backLCDetails": null
  }, {
    "askUsSetId": null,
    "frontLCDetails": {
      "learningCardDetails": {
        "multimediaType": "text",
        "multimediaThumbnailURL": "",
        "lcMultimedia": "",
        "lcContentType": "EnglishPattern",
        "lcStatus": "COMPLETED",
        "lcMaximumPoints": 10,
        "t2sURL": "",
        "lcName": "",
        "lcId": 64912,
        "lcPoints": 10,
        "askUsSetId": null,
        "lcContent": "images/type/AFF.png|||images/NO_IMAGE.png|||images/NO_IMAGE.png|||-|||-|||Types of Sentences|||Affirmative|||"
      },
      "cardType": "CARD",
      "questionDetails": null
    },
    "lcStatus": "NOT_COMPLETED",
    "lcMaximumPoints": 10,
    "lcId": 64912,
    "lcPoints": 10,
    "backLCDetails": null
  }, {
    "askUsSetId": null,
    "frontLCDetails": {
      "learningCardDetails": {
        "multimediaType": "text",
        "multimediaThumbnailURL": "",
        "lcMultimedia": "",
        "lcContentType": "EnglishPattern",
        "lcStatus": "COMPLETED",
        "lcMaximumPoints": 10,
        "t2sURL": "",
        "lcName": "",
        "lcId": 64913,
        "lcPoints": 10,
        "askUsSetId": null,
        "lcContent": "images/type/INTRR_NEG.png|||images/NO_IMAGE.png|||images/NO_IMAGE.png|||-|||-|||Types of Sentences|||Yes/No Negative Interrogative|||"
      },
      "cardType": "CARD",
      "questionDetails": null
    },
    "lcStatus": "NOT_COMPLETED",
    "lcMaximumPoints": 10,
    "lcId": 64913,
    "lcPoints": 10,
    "backLCDetails": null
  }, {
    "askUsSetId": null,
    "frontLCDetails": {
      "learningCardDetails": {
        "multimediaType": "text",
        "multimediaThumbnailURL": "",
        "lcMultimedia": "",
        "lcContentType": "EnglishPattern",
        "lcStatus": "COMPLETED",
        "lcMaximumPoints": 10,
        "t2sURL": "",
        "lcName": "",
        "lcId": 64914,
        "lcPoints": 10,
        "askUsSetId": null,
        "lcContent": "images/type/INTRR.png|||images/NO_IMAGE.png|||images/NO_IMAGE.png|||-|||-|||Types of Sentences|||Yes/No Interrogative|||"
      },
      "cardType": "CARD",
      "questionDetails": null
    },
    "lcStatus": "NOT_COMPLETED",
    "lcMaximumPoints": 10,
    "lcId": 64914,
    "lcPoints": 10,
    "backLCDetails": null
  }],
  currentLcSetId: 222,
}
var isEndOfPagination = false;
var isSetCompleted = false;

export function learningCardsReducer (state = learningCardState,action){
  switch(action.type){
     case constants.GETCARDS:

        return Object.assign({},
              state,
              {
                currentLcSetId : action.setId,
                learningCards: action.learningCards
              }
        );
      case constants.UPDATE_CARDS:
        return Object.assign({},
              state,
              {
                learningCards: action.learningCards
              }
        );
      default:
        return state;
  }
}

export default {
  learningCardsReducer
}
