React component to display craft ai operations history
npm install react-craft-ai-operations-historyreact-craft-ai-operations-history 
OperationHistory is a React component aiming at displaying the context operations of a craft ai agent.
A very basic usage looks like that
``js`
initialOperations={myAgentOperations}
/>
Where myAgentConfiguration and myAgentOperationsare data structures that can be retrieved from the craft ai API.
The component can be used with _load as you scroll_ strategy using the following props
`jsrequestInitialState
from={myAgent.firstTimestamp}
to={myAgent.lastTimestamp}
onRequestOperations={(requestedFrom, requestedTo, requestInitialState) => {
/ ... /
return {
operations, // The retrieved operations
from, // The first timestamp that was requested
to, // The last timestamp that was requested
initialState // If is true, the full state of the agent at from`
};
}}
/>
The configuration of the agent.
A function taking three parameters:
- requestedFrom the desired operations timestamp lower bound,requestedTo
- the desired operations timestamp upper bound,requestInitialState
- a boolean telling if the full state at from is needed.
This function can return a promise and returns an object having the following properties:
- operations the retrieved operations as an array,from
- the first timestamp that was requested (can be different from requestedFrom, because of page alignment for example),to
- the last timestamp that was requested (can be different from requestedTo, because of page alignment for example),initialState
- , if requestInitialState is true, the full state of the agent at from.
The height, in pixels, of the rows.
The height, in pixels, of the full table.
The width, in pixels, of the full table, if undefined` the table will take the full available width.
Array of already loaded operations.
The agent's operations timestamp upper bound.
The agent's operations timestamp lower bound.
The timestamp that should be highlighted.