"use client";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
/*
* Tiny markdown renderer for Hebrew prose blocks — paragraphs, lists,
* emphasis, and GFM tables (the main reason this exists). The parsed
* research_md fields and the conclusions field both contain tables
* like "ציר דיוני" that we want to render as real
s, RTL, with
* auto-sized columns that line up row-to-row.
*
* Table styling uses `table-auto` + `whitespace-nowrap` on header cells
* so the column widths are dictated by the longest cell in that column,
* and every row's borders align exactly underneath each other. The
* overflow-x-auto wrapper catches extremely wide tables on narrow
* viewports without letting the parent card grow.
*/
export function Markdown({ content }: { content: string }) {
return (
(
),
strong: ({ node: _n, ...props }) => (
),
em: ({ node: _n, ...props }) => (
),
a: ({ node: _n, ...props }) => (
),
ul: ({ node: _n, ...props }) => (
),
ol: ({ node: _n, ...props }) => (
),
li: ({ node: _n, ...props }) => (
),
h1: ({ node: _n, ...props }) => (
),
h2: ({ node: _n, ...props }) => (
),
h3: ({ node: _n, ...props }) => (
),
blockquote: ({ node: _n, ...props }) => (
),
code: ({ node: _n, ...props }) => (
),
/* ── Tables ─────────────────────────────────────────────────
Wrapped in an overflow-x-auto so very wide tables don't push
the parent card out of its track. table-auto lets the browser
size columns by their longest cell (that's what keeps borders
aligned row-to-row) and whitespace-nowrap on the headers
ensures the header row sets column widths instead of
breaking mid-word. */
table: ({ node: _n, ...props }) => (
),
thead: ({ node: _n, ...props }) => (
),
tbody: ({ node: _n, ...props }) => ,
tr: ({ node: _n, ...props }) => (
),
th: ({ node: _n, ...props }) => (
|
),
td: ({ node: _n, ...props }) => (
|
),
hr: ({ node: _n, ...props }) => (
),
}}
>
{content}
);
}