import {
  ReviewQuestionContentHeader
} from "./chunk-IYM372DE.js";
import {
  TextArea
} from "./chunk-3F45OPXG.js";
import {
  Callout
} from "./chunk-B6XJN6EC.js";
import {
  Card
} from "./chunk-HEDMSFPW.js";
import {
  Grid
} from "./chunk-EGEQY3KT.js";
import {
  Typo
} from "./chunk-PARGQUJB.js";
import {
  Box
} from "./chunk-4Y5BEXVN.js";
import {
  BellIcon
} from "./chunk-V5XKNSCK.js";

// src/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.tsx
import { jsx, jsxs } from "react/jsx-runtime";
function ReviewQuestionText(props) {
  const { question, answer, onChange } = props;
  const minLengthNotMet = question.minLength && answer.length < question.minLength;
  const remainingLength = question.minLength && answer.length < question.minLength ? question.minLength - answer.length : 0;
  return /* @__PURE__ */ jsx(
    Card,
    {
      size: "2",
      style: {
        width: "100%",
        height: "100%"
      },
      children: /* @__PURE__ */ jsxs(Grid, { height: "100%", rows: "1fr auto", children: [
        /* @__PURE__ */ jsxs(Grid, { height: "100%", rows: "auto 1fr", width: "100%", children: [
          /* @__PURE__ */ jsx(
            ReviewQuestionContentHeader,
            {
              icon: question.icon,
              question: question.question,
              title: question.title,
              type: question.type
            }
          ),
          /* @__PURE__ */ jsx(
            TextArea,
            {
              mt: "2",
              onChange: (e) => {
                onChange(e.target.value);
              },
              placeholder: question.placeholder,
              value: answer
            }
          )
        ] }),
        minLengthNotMet ? /* @__PURE__ */ jsxs(Box, { mt: "2", children: [
          /* @__PURE__ */ jsx(Typo, { align: "right", as: "p", color: "red", variant: "caption", children: `${remainingLength}\uC790 \uB354 \uC791\uC131\uD574\uC8FC\uC138\uC694.` }),
          question.minLengthInfoMessage ? /* @__PURE__ */ jsxs(
            Callout.Root,
            {
              color: "iris",
              mt: "2",
              style: { alignItems: "center" },
              children: [
                /* @__PURE__ */ jsx(Callout.Icon, { children: /* @__PURE__ */ jsx(BellIcon, {}) }),
                /* @__PURE__ */ jsx(Callout.Text, { children: /* @__PURE__ */ jsx(Typo, { as: "p", variant: "caption", children: question.minLengthInfoMessage }) })
              ]
            }
          ) : null
        ] }) : null
      ] })
    }
  );
}
var review_question_text_default = ReviewQuestionText;

export {
  review_question_text_default
};
//# sourceMappingURL=chunk-KMUJLH55.js.map