"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importStar(require("react"));
var styled_components_1 = __importDefault(require("@xstyled/styled-components"));
var Frame_1 = __importDefault(require("../Frame"));
var Tooltip_1 = __importDefault(require("../Tooltip"));
var StyledTooltip = styled_components_1.default(Tooltip_1.default)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  div:first-child {\n    right: 0;\n  }\n"], ["\n  div:first-child {\n    right: 0;\n  }\n"])));
var Clock = function () {
    var _a = react_1.useState(''), timer = _a[0], setTimer = _a[1];
    react_1.useEffect(function () {
        function checkTime(i) {
            return i < 10 ? "0" + i : i;
        }
        var interval = setInterval(function () {
            var today = new Date();
            var h = today.getHours();
            var m = today.getMinutes();
            setTimer(checkTime(h) + ":" + checkTime(m));
        });
        return function () { return clearInterval(interval); };
    });
    return (react_1.default.createElement(Frame_1.default, { boxShadow: "in", bg: "transparent", px: 6, py: 2, style: {
            display: 'flex',
            justifyContent: 'center',
            alignItems: 'center',
        } },
        react_1.default.createElement(StyledTooltip, null, timer)));
};
exports.default = Clock;
var templateObject_1;
//# sourceMappingURL=Clock.js.map