"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var react_router_dom_1 = require("react-router-dom");
function OrderCompleted(props) {
    var _a = React.useState(false), mounted = _a[0], setMounted = _a[1];
    React.useEffect(function () {
        document.title = "Shrnutí";
        if (props.location.state !== undefined && !mounted) {
            props.clearShoppingCart();
        }
        setMounted(true);
    });
    if (props.location.state !== undefined) {
        return (React.createElement(React.Fragment, null,
            React.createElement("section", { className: "product-details" },
                React.createElement("div", { className: "container" },
                    React.createElement("div", { className: "row" },
                        React.createElement("div", { className: "col" },
                            React.createElement("h4", { style: { paddingBottom: 25 } },
                                "Objedn\u00E1vka s \u010D\u00EDslem ",
                                props.location.state.orderNumber,
                                " a celkovou cenou ",
                                props.location.state.totalPrice,
                                " K\u010D \u00FAsp\u011B\u0161n\u011B vytvo\u0159ena"),
                            React.createElement("p", null,
                                "Va\u0161e objedn\u00E1vka byla p\u0159ijata ke zpracov\u00E1n\u00ED. O pr\u016Fb\u011Bhu zpracov\u00E1n\u00ED objedn\u00E1vky V\u00E1s budeme informovat na V\u00E1mi zadanou emailovou adresu.",
                                React.createElement("br", null),
                                "D\u011Bkujeme, \u017Ee u n\u00E1s nakupujete!"))),
                    React.createElement("div", { className: "row", style: { paddingBottom: 50 } },
                        React.createElement("div", { className: "col" },
                            React.createElement(react_router_dom_1.Link, { className: "primary-btn", to: "/" }, "Zp\u011Bt na hlavn\u00ED str\u00E1nku")))))));
    }
    else {
        return React.createElement(react_router_dom_1.Redirect, { to: "/" });
    }
}
exports.default = OrderCompleted;
//# sourceMappingURL=OrderCompleted.js.map