Pass in actual code snippet to codeblock

This commit is contained in:
bkellam 2024-08-24 21:34:24 -07:00
parent fce25841cd
commit 898b329fc9

View file

@ -165,14 +165,18 @@ const FileMatch = ({
return ( return (
<div> <div>
<div className="bg-cyan-200 primary-foreground px-2"> <div className="bg-cyan-200 primary-foreground px-2">
<span className="font-medium">{match.Repo}</span> · {match.FileName} <span>{match.Repo} · {match.FileName}</span>
</div> </div>
{/* Code block */} {match.Matches.map((match, index) => {
<div className="font-mono px-4"> const fragment = match.Fragments[0];
<p>{"1: if (my_ptr->asdf) {"}</p>
<p>{"2: doSomething()"}</p> return (
<p>{"3: }"}</p> <div key={index} className="font-mono px-4 py-0.5 text-sm">
<p>{match.LineNum}: {fragment.Pre}<span className="font-bold">{fragment.Match}</span>{fragment.Post}</p>
<Separator />
</div> </div>
);
})}
</div> </div>
); );
} }