import { jsx } from "react/jsx-runtime";
import { tcx } from "@choiceform/design-system";
import { memo } from "react";
import { promptCharacterCountTv } from "./tv.js";
import { usePromptInputContext } from "../../context/prompt-input-context.js";
const PromptCharacterCount = memo(function PromptCharacterCount2(props) {
  const { children, className } = props;
  const { inputValue } = usePromptInputContext();
  const charCount = inputValue.text.length;
  const tv = promptCharacterCountTv();
  if (charCount === 0) return null;
  return /* @__PURE__ */ jsx("div", { className: tcx(tv.root(), className), children: children ? children(charCount) : charCount });
});
export {
  PromptCharacterCount
};
//# sourceMappingURL=prompt-character-count.js.map
