function bookClicked(event) {
    let clickedBookCode = event.currentTarget.getAttribute("data-bookcode");
    //if opened book clicked, close it else open it
    if (openBookCode !== clickedBookCode) {
      setChapterRow(parseInt(event.currentTarget.getAttribute("data-row")));
      setOpenBookCode(clickedBookCode);
    } else {
      setOpenBookCode("");
      setChapterRow(-1);
    }
  }
//function to set book once its clicked and open the chapter list for it
function to set book once its clicked and open the chapter list for it
function to set book once its clicked and open the chapter list for it
function bookClicked(event) {
    let clickedBookCode = event.currentTarget.getAttribute("data-bookcode");
    if (openBookCode !== clickedBookCode) {
      setChapterRow(parseInt(event.currentTarget.getAttribute("data-row")));
      setOpenBookCode(clickedBookCode);
    } else {
      setOpenBookCode("");
      setChapterRow(-1);
    }
  }
function bookClicked ( event ) { let clickedBookCode = event . currentTarget . getAttribute ( "data-bookcode" ) ; if ( openBookCode !== clickedBookCode ) { setChapterRow ( parseInt ( event . currentTarget . getAttribute ( "data-row" ) ) ) ; setOpenBookCode ( clickedBookCode ) ; } else { setOpenBookCode ( "" ) ; setChapterRow ( - 1 ) ; } }
function to set book once its clicked and open the chapter list for it
function to set book once its clicked and open the chapter list for it
//if opened book clicked, close it else open it