HistoryEntries
A definition of a custom component that will be used to render the given type of history entry.
Example
type
stringThe type should correspond to a valid HistoryEntryType, such as
CUSTOMER_REGISTEREDORDER_STATE_TRANSITION- some custom type - see the HistoryService docs for a guide on how to define custom history entry types.
component
React.ComponentType<{ entry: HistoryEntryItem; entity: OrderHistoryOrderDetail | CustomerHistoryCustomerDetail; }>The component which is used to render the timeline entry. It should use the HistoryEntry component and pass the appropriate props to configure how it will be displayed.
The entity prop will be a subset of the Order object for Order history entries,
or a subset of the Customer object for customer history entries.
This object contains the information about the history entry.
id
stringtype
stringThe HistoryEntryType, such as ORDER_STATE_TRANSITION.
createdAt
stringisPublic
booleanWhether this entry is visible to customers via the Shop API
administrator
{ id: string; firstName: string; lastName: string; } | nullIf an Administrator created this entry, their details will be available here.
data
anyThe entry payload data. This will be an object, which is different for each type of history entry.
For example, the CUSTOMER_ADDED_TO_GROUP data looks like this:
and the ORDER_STATE_TRANSITION data looks like this:
The props for the HistoryEntry component.
entry
HistoryEntryItemThe entry itself, which will get passed down to your custom component
title
string | React.ReactNodeThe title of the entry
timelineIcon
React.ReactNodeAn icon which is used to represent the entry. Note that this will only
display if isPrimary is true.
timelineIconClassName
stringOptional tailwind classes to apply to the icon. For instance
actorName
stringThe name to display of "who did the action". For instance:
children
React.ReactNodeisPrimary
booleanWhen set to true, the timeline entry will feature the specified icon and will not
be collapsible.
A component which is used to display a history entry in the order/customer history timeline.
Parameters
props
Readonly<HistoryEntryProps>