import React from "react";
import Box from "@material-ui/core/Box";
import Table from "@material-ui/core/Table";
import TableBody from "@material-ui/core/TableBody";
import TableRow from "@material-ui/core/TableRow";
import TableCell from "@material-ui/core/TableCell";
import Button from "@material-ui/core/Button";
import useDatasetProperty from "../../hooks/use-dataset-property";
var usdFormatter = new Intl.NumberFormat("en-US", {
  style: "currency",
  currency: "USD"
});
export var LabelHelpCompleted = function LabelHelpCompleted(_ref) {
  var onChangeActiveStep = _ref.onChangeActiveStep;

  var _useDatasetProperty = useDatasetProperty("labelHelp"),
      labelHelp = _useDatasetProperty.labelHelp,
      updateLabelHelp = _useDatasetProperty.updateLabelHelp;

  return /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Table, null, /*#__PURE__*/React.createElement(TableBody, null, /*#__PURE__*/React.createElement(TableRow, null, /*#__PURE__*/React.createElement(TableCell, null, "Percent Complete"), /*#__PURE__*/React.createElement(TableCell, null, "100%")), (labelHelp === null || labelHelp === void 0 ? void 0 : labelHelp.totalCost) && /*#__PURE__*/React.createElement(TableRow, null, /*#__PURE__*/React.createElement(TableCell, null, "Total Cost"), /*#__PURE__*/React.createElement(TableCell, null, usdFormatter.format(labelHelp === null || labelHelp === void 0 ? void 0 : labelHelp.totalCost))))), /*#__PURE__*/React.createElement(Box, {
    display: "flex",
    marginTop: 2,
    justifyContent: "flex-end"
  }, /*#__PURE__*/React.createElement(Button, {
    onClick: function onClick() {
      updateLabelHelp(null);
      onChangeActiveStep("setup");
    },
    variant: "outlined"
  }, "Restart")));
};
export default LabelHelpCompleted;