Function
MarkdownTable
({ headers, rows, className }: MarkdownTableProps)
Source from the content-addressed store, hash-verified
| 132 | } |
| 133 | |
| 134 | export function MarkdownTable({ headers, rows, className }: MarkdownTableProps) { |
| 135 | return ( |
| 136 | <div className={cn("overflow-x-auto my-2", className)}> |
| 137 | <table className="w-full text-xs border-collapse font-mono"> |
| 138 | <thead> |
| 139 | <tr> |
| 140 | {headers.map((h, i) => ( |
| 141 | <th |
| 142 | key={i} |
| 143 | className="px-2 py-1 text-left border border-surface-700 bg-surface-800 font-semibold text-surface-200" |
| 144 | > |
| 145 | {h} |
| 146 | </th> |
| 147 | ))} |
| 148 | </tr> |
| 149 | </thead> |
| 150 | <tbody> |
| 151 | {rows.map((row, ri) => ( |
| 152 | <tr key={ri}> |
| 153 | {row.map((cell, ci) => ( |
| 154 | <td |
| 155 | key={ci} |
| 156 | className={cn( |
| 157 | "px-2 py-1 border border-surface-700 text-surface-300", |
| 158 | ri % 2 === 1 && "bg-surface-900/40" |
| 159 | )} |
| 160 | > |
| 161 | {cell} |
| 162 | </td> |
| 163 | ))} |
| 164 | </tr> |
| 165 | ))} |
| 166 | </tbody> |
| 167 | </table> |
| 168 | </div> |
| 169 | ); |
| 170 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected