"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 __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (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.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var jsx_runtime_1 = require("react/jsx-runtime");
var react_1 = require("react");
var styled_components_1 = __importStar(require("styled-components"));
var GridRow = function (props) {
    var find = props.find, isMobileWidth = props.isMobileWidth, task = props.task, header = props.header, hideLanguage = props.hideLanguage;
    var styles = (0, react_1.useMemo)(function () {
        return header
            ? {}
            : {
                background: isMobileWidth ? "#eeedff" : "transparent",
            };
    }, [header, isMobileWidth]);
    if (!find) {
        return ((0, jsx_runtime_1.jsxs)(StyledGridRow, { children: [(0, jsx_runtime_1.jsx)(StyledGridCell, __assign({ header: header, isMobileWidth: isMobileWidth, style: {
                        gridRow: isMobileWidth ? "1/3" : "auto",
                    } }, { children: task })), (0, jsx_runtime_1.jsx)(StyledGridCell, __assign({ header: header, isMobileWidth: isMobileWidth, style: {
                        gridRow: isMobileWidth ? "1/3" : "auto",
                        gridColumn: isMobileWidth ? "2/6" : "2/11",
                    } }, { children: "\uC218\uD589 \uC5C6\uC74C" }))] }));
    }
    else {
        return ((0, jsx_runtime_1.jsxs)(StyledGridRow, { children: [(0, jsx_runtime_1.jsx)(StyledGridCell, __assign({ header: header, isMobileWidth: isMobileWidth, style: {
                        gridRow: isMobileWidth ? "1/3" : "auto",
                    } }, { children: task })), (0, jsx_runtime_1.jsx)(StyledGridCell, __assign({ header: header, order: 1, isMobileWidth: isMobileWidth }, { children: parseFloat(find.level.toFixed(1)) })), (0, jsx_runtime_1.jsxs)(StyledGridCell, __assign({ header: header, order: 3, isMobileWidth: isMobileWidth }, { children: [parseFloat(find.reculsiveCount.toFixed(1)), "\uD68C"] })), (0, jsx_runtime_1.jsxs)(StyledGridCell, __assign({ header: header, order: 4, isMobileWidth: isMobileWidth, style: { display: isMobileWidth ? "none" : "flex" } }, { children: [parseFloat(find.weeklyPerformedDays.toFixed(1)), "\uC77C"] })), (0, jsx_runtime_1.jsxs)(StyledGridCell, __assign({ header: header, order: 6, isMobileWidth: isMobileWidth }, { children: [parseFloat((find.performedRatio * 100).toFixed(1)), "%"] })), (0, jsx_runtime_1.jsxs)(StyledGridCell, __assign({ header: header, order: 8, isMobileWidth: isMobileWidth }, { children: [parseFloat(find.avgScore.toFixed(1)), "\uC810"] })), (0, jsx_runtime_1.jsx)(StyledGridCell, __assign({ header: header, order: 2, isMobileWidth: isMobileWidth, style: styles }, { children: hideLanguage ? "" : find.language })), (0, jsx_runtime_1.jsx)(StyledGridCell, __assign({ header: header, order: 5, isMobileWidth: isMobileWidth, style: styles }, { children: isMobileWidth ? "".concat(find.performedCount, "\uD68C") : "".concat(find.performedCount, " / ").concat(find.needPerformedCount) })), (0, jsx_runtime_1.jsxs)(StyledGridCell, __assign({ header: header, order: 7, isMobileWidth: isMobileWidth, style: styles }, { children: [parseFloat(find.totDuration.toFixed(1)), "\uBD84"] })), (0, jsx_runtime_1.jsxs)(StyledGridCell, __assign({ header: header, order: 9, isMobileWidth: isMobileWidth, style: styles }, { children: [parseFloat(find.totScore.toFixed(1)), "\uC810"] }))] }));
    }
};
exports.default = GridRow;
var StyledGridRow = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  width: 100%;\n  min-height: 3em;\n  display: grid;\n  justify-content: center;\n  align-items: center;\n  border-collapse: collapse;\n\n  grid-template-rows: 1fr 1fr;\n  grid-template-columns: 1.3fr repeat(4, 1fr);\n\n  @media screen and (min-width: 501px) {\n    min-height: 4em;\n    grid-template-rows: 1fr;\n    grid-template-columns: 1fr repeat(9, 0.5fr);\n  }\n"], ["\n  width: 100%;\n  min-height: 3em;\n  display: grid;\n  justify-content: center;\n  align-items: center;\n  border-collapse: collapse;\n\n  grid-template-rows: 1fr 1fr;\n  grid-template-columns: 1.3fr repeat(4, 1fr);\n\n  @media screen and (min-width: 501px) {\n    min-height: 4em;\n    grid-template-rows: 1fr;\n    grid-template-columns: 1fr repeat(9, 0.5fr);\n  }\n"])));
var StyledGridCell = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n  height: 100%;\n  padding: 0.5em 0;\n  border-right: 1px solid #ada9bb;\n  border-bottom: 1px solid #ada9bb;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  text-align: center;\n\n  ", "\n  ", "\n"], ["\n  height: 100%;\n  padding: 0.5em 0;\n  border-right: 1px solid #ada9bb;\n  border-bottom: 1px solid #ada9bb;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  text-align: center;\n\n  ", "\n  ", "\n"])), function (props) {
    return props.header
        ? (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n          font-size: 1.2em;\n          font-weight: 700;\n          background: #eeedff;\n          @media screen and (min-width: 1024px) {\n            font-size: 1.4em;\n          }\n        "], ["\n          font-size: 1.2em;\n          font-weight: 700;\n          background: #eeedff;\n          @media screen and (min-width: 1024px) {\n            font-size: 1.4em;\n          }\n        "]))) : (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n          font-size: 1.1em;\n          @media screen and (min-width: 1024px) {\n            font-size: 1.2em;\n          }\n        "], ["\n          font-size: 1.1em;\n          @media screen and (min-width: 1024px) {\n            font-size: 1.2em;\n          }\n        "])));
}, function (props) {
    return !props.isMobileWidth && props.order
        ? (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n          order: ", ";\n        "], ["\n          order: ", ";\n        "])), props.order) : (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject([""], [""])));
});
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
