import React__default, { useState, useEffect } from "react";
function useLineCount(children) {
  const [lineCount, setLineCount] = useState(0);
  useEffect(() => {
    const codeContent = React__default.Children.toArray(children).map((child) => {
      if (React__default.isValidElement(child) && child.props.code) {
        return child.props.code;
      }
      return "";
    }).join("");
    if (codeContent) {
      const lines = codeContent.split("\n").length;
      setLineCount(lines);
    }
  }, [children]);
  return lineCount;
}
export {
  useLineCount
};
//# sourceMappingURL=use-line-count.js.map
