import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { ResultTitle, ResultContainer, HighlightableText, ResultLink, ResultTextContent, } from "../../../renderer-components";
import { FileIcon } from "../../../renderer-components/FileIcon";
import { css } from "styled-components";
export function DocumentResult({ result }) {
    return (_jsxs(ResultContainer, { icon: _jsx(FileIcon, { result: result }), children: [_jsx(ResultTitle, { children: _jsx(HighlightableText, { result: result, path: "document.title" }) }), _jsx(ResultLink, { href: result.source.document.url, children: _jsx(HighlightableText, { result: result, path: "document.url" }) }), "document.content" in result.highlight ? (_jsx("div", { css: css `
            margin-top: 8px;
            max-width: 100%;
            line-height: 1em;
            max-height: 6em;
            overflow: hidden;
            text-overflow: ellipsis;
            word-wrap: break-word;
            word-break: break-word;
          `, children: _jsx(HighlightableText, { result: result, path: "document.content" }) })) : (_jsx("div", { css: css `
            margin-top: 8px;
            max-width: 100%;
            line-height: 1em;
            max-height: 6em;
            overflow: hidden;
            text-overflow: ellipsis;
            word-wrap: break-word;
            word-break: break-word;
          `, children: _jsx(ResultTextContent, { result: result, path: "document.summary" }) }))] }));
}
