mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-05 19:32:11 +02:00
Merge commit 'a8390532f7' as 'ai-context/workbench-ui'
This commit is contained in:
commit
1a72bfdec0
310 changed files with 56430 additions and 0 deletions
59
ai-context/workbench-ui/src/model/processing-table.tsx
Normal file
59
ai-context/workbench-ui/src/model/processing-table.tsx
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
import { createColumnHelper } from "@tanstack/react-table";
|
||||
import { Tag } from "@chakra-ui/react";
|
||||
import { timeString } from "../utils/time-string.ts";
|
||||
|
||||
/**
|
||||
* Processing data structure for the processing table
|
||||
* Represents a single processing object with its metadata and properties
|
||||
*/
|
||||
export type Processing = {
|
||||
id: string; // Unique identifier for the processing
|
||||
time: number; // Timestamp (likely Unix timestamp)
|
||||
document: string; // Document ID
|
||||
tags: string[]; // Array of tags associated with the document
|
||||
};
|
||||
|
||||
// Create a column helper instance for type-safe column definitions
|
||||
export const columnHelper = createColumnHelper<Processing>();
|
||||
|
||||
/**
|
||||
* Column definitions for the processing table
|
||||
* Defines how each column should be rendered and what data it displays
|
||||
*/
|
||||
export const columns = [
|
||||
// ID column - displays the flow ID
|
||||
columnHelper.accessor("id", {
|
||||
header: "ID",
|
||||
cell: (info) => info.getValue(),
|
||||
}),
|
||||
|
||||
// Time column - displays formatted timestamp
|
||||
columnHelper.accessor("time", {
|
||||
header: "Time",
|
||||
cell: (info) => timeString(info.getValue()), // Convert to readable string
|
||||
}),
|
||||
|
||||
// Class name column - displays flow class
|
||||
columnHelper.accessor("document-id", {
|
||||
header: "Document ID",
|
||||
cell: (info) => info.getValue(),
|
||||
}),
|
||||
|
||||
// Class name column - displays flow class
|
||||
columnHelper.accessor("flow", {
|
||||
header: "Flow ID",
|
||||
cell: (info) => info.getValue(),
|
||||
}),
|
||||
|
||||
// Tags column - displays document tags as visual tag components
|
||||
columnHelper.accessor("tags", {
|
||||
header: "Tags",
|
||||
cell: (info) =>
|
||||
// Render each tag as a Chakra UI Tag component with margin spacing
|
||||
info.getValue()?.map((t) => (
|
||||
<Tag.Root key={t} mr={2}>
|
||||
<Tag.Label>{t}</Tag.Label>
|
||||
</Tag.Root>
|
||||
)),
|
||||
}),
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue