import { jsx as _jsx } from "react/jsx-runtime";
import { HighlightedText } from "./HighlightedText";
import get from "lodash/get";
import { css } from "styled-components";
import { truncatedLineStyle } from "./truncatedLineStyle";
export function ResultTextContent({ result, path, isTruncate = true, }) {
    const hihglithTextLines = result.highlight[path];
    const text = get(result.source, path);
    return (_jsx("div", { className: "openk9--result-text-content", css: css `
        ${hihglithTextLines ? truncatedLineStyle : ""};
        margin: 0;
      `, children: hihglithTextLines ? (hihglithTextLines.map((text, index) => (_jsx("div", { css: truncatedLineStyle, children: _jsx(HighlightedText, { text: text }) }, index)))) : (_jsx("div", { className: "openk9-embeddable--result-text-content", css: isTruncate
                ? css `
                  display: -webkit-box;
                  -webkit-line-clamp: 3;
                  -webkit-box-orient: vertical;
                  overflow: hidden;
                `
                : undefined, children: text })) }));
}
