MCPcopy Create free account
hub / github.com/triggerdotdev/trigger.dev / render

Method render

packages/cli-v3/src/utilities/ink-table.tsx:201–231  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

199
200 /* Render */
201 override render() {
202 /* Data */
203 const columns = this.getColumns();
204 const headings = this.getHeadings();
205
206 /**
207 * Render the table line by line.
208 */
209 return (
210 <Box flexDirection="column">
211 {/* Header */}
212 {this.header({ key: "header", columns, data: {} })}
213 {this.heading({ key: "heading", columns, data: headings })}
214 {/* Data */}
215 {this.props.data.map((row, index) => {
216 // Calculate the hash of the row based on its value and position
217 const key = `row-${sha1(row)}-${index}`;
218
219 // Construct a row.
220 return (
221 <Box flexDirection="column" key={key}>
222 {this.separator({ key: `separator-${key}`, columns, data: {} })}
223 {this.data({ key: `data-${key}`, columns, data: row })}
224 </Box>
225 );
226 })}
227 {/* Footer */}
228 {this.footer({ key: "footer", columns, data: {} })}
229 </Box>
230 );
231 }
232}
233
234/* Helper components */

Callers

nothing calls this directly

Calls 2

getColumnsMethod · 0.95
getHeadingsMethod · 0.95

Tested by

no test coverage detected