aboutsummaryrefslogtreecommitdiffstats
path: root/public/projects/react-small-apps/apps/notebook/src/components/layout/Page/PageToolbar.js
blob: a16aa2240f539f0766239a41153e374c28d609bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { Button } from "../../commons";
import { ReactComponent as TrashIcon } from "../../../images/trash.svg";
import { ReactComponent as RestoreIcon } from "../../../images/restore.svg";

function PageToolbar({ removePage, restorePage, deletedPages }) {
  return (
    <div className="notebook-page__toolbar toolbar">
      <div className="toolbar__item">
        {deletedPages.length > 0 && (
          <Button modifier="restore" onClickHandler={restorePage}>
            <RestoreIcon
              title="Undo page deletion"
              className="icon icon--restore"
            />
          </Button>
        )}
      </div>
      <div className="toolbar__item">
        <Button modifier="delete" onClickHandler={removePage}>
          <TrashIcon title="Delete this page" className="icon icon--trash" />
        </Button>
      </div>
    </div>
  );
}

export default PageToolbar;