import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { prism, vscDarkPlus, } from 'react-syntax-highlighter/dist/esm/styles/prism';
import { formatDuration } from './utils';
export function GitCommitRenderer({ contentJson, toolDurationMs, }) {
    const result = contentJson.result || {};
    const message = String(result.message || '');
    const timeStr = formatDuration(toolDurationMs);
    const syntaxTheme = document?.documentElement.classList.contains('dark')
        ? vscDarkPlus
        : prism;
    return (_jsxs("div", { className: "text-xs space-y-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "font-medium text-emerald-700 dark:text-emerald-300", children: "git commit" }), _jsx("span", { className: "text-muted-foreground/70", children: "\u00B7" }), _jsx("span", { className: "text-muted-foreground/80", children: timeStr })] }), message && (_jsx("div", { className: "bg-card/60 border border-border rounded-lg overflow-hidden max-w-full", children: _jsx("div", { className: "overflow-x-auto max-w-full", children: _jsx(SyntaxHighlighter, { language: "bash", style: syntaxTheme, customStyle: {
                            margin: 0,
                            padding: '0.75rem',
                            fontSize: '0.75rem',
                            lineHeight: '1.5',
                            background: 'transparent',
                            maxWidth: '100%',
                        }, wrapLines: true, wrapLongLines: true, children: message }) }) }))] }));
}
//# sourceMappingURL=GitCommitRenderer.js.map