import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
import { HighlightedText } from "./HighlightedText";
import get from "lodash/get";
export function HighlightableText({ result, path, }) {
    const hihglithText = result.highlight[path]?.[0];
    const text = get(result.source, path);
    if (hihglithText) {
        return _jsx(HighlightedText, { text: hihglithText });
    }
    return _jsx(_Fragment, { children: text });
}
