import React, { Component } from 'react';
import { DragDropContext } from "react-dnd";
import HTML5Backend from "react-dnd-html5-backend";
import './BoardSet.css';

import { Board, Hand, Piece, PieceHand } from 'kifu-for-js';

// Use svg images
Piece.DecoratedComponent.prototype.getPieceImage = PieceHand.DecoratedComponent.prototype.getPieceImage = (kind, color) => {
  return `/images/shogi-pieces/${!kind ? "blank.gif" : color + kind + ".svg"}`;
};

class BoardSet extends Component {
  constructor() {
    super();
    this.imageDirectoryPath = "./images";
  }
  render() {
    const player = this.props.player;
    const reversed = this.props.reversed;
    const playerState = player.getState();
    const players = [
      player.kifu.header["先手"] || player.kifu.header["下手"] || "先手",
      player.kifu.header["後手"] || player.kifu.header["上手"] || "後手",
    ];

    return (
      <div>
        <div className="boardSet">
          <div className="players left">
            <Hand color={reversed ? 0 : 1} data={playerState.hands[reversed ? 0 : 1]} playerName={players[reversed ? 0 : 1]} ImageDirectoryPath={this.imageDirectoryPath} onInputMove={e => { this.props.onInputMove(e) }} reversed={reversed} />
          </div>
          <div className="board">
            <Board board={playerState.board}
              lastMove={player.getMove()}
              ImageDirectoryPath={this.imageDirectoryPath}
              onInputMove={e => { this.props.onInputMove(e) }}
              reversed={reversed} />
          </div>
          <div className="players right">
            <Hand color={reversed ? 1 : 0} data={playerState.hands[reversed ? 1 : 0]} playerName={players[reversed ? 1 : 0]} ImageDirectoryPath={this.imageDirectoryPath} onInputMove={e => { this.props.onInputMove(e) }} reversed={reversed} />
          </div>
          <div>
            <textarea rows="10" className="comment" placeholder="ここに現在の手についてコメントを書けます。" onChange={e => { this.props.onChangeComments(e.target.value); }} value={player.getComments().join("\n")}></textarea>
          </div>
        </div>
      </div>
    )
  }
}

export default DragDropContext(HTML5Backend)(BoardSet);

@@ -486,85 +486,8 @@
 t %7B%0A
-  constructor() %7B%0A    super();%0A    this.imageDirectoryPath = %22./images%22;%0A  %7D%0A
   re
@@ -495,16 +495,16 @@
 der() %7B%0A
+
     cons
@@ -1013,53 +1013,8 @@
  1%5D%7D
- ImageDirectoryPath=%7Bthis.imageDirectoryPath%7D
  onI
@@ -1224,67 +1224,8 @@
 ()%7D%0A
-              ImageDirectoryPath=%7Bthis.imageDirectoryPath%7D%0A
     
@@ -1375,24 +1375,24 @@
 ers right%22%3E%0A
+
             
@@ -1507,53 +1507,8 @@
  0%5D%7D
- ImageDirectoryPath=%7Bthis.imageDirectoryPath%7D
  onI

Remove ImageDirectoryPath, not used any more