11import { useMemo } from 'react' ;
22
3+ import WorkflowHistoryEventDetailsEntry from '@/views/workflow-history/workflow-history-event-details-entry/workflow-history-event-details-entry' ;
34import WorkflowHistoryEventDetailsGroup from '@/views/workflow-history/workflow-history-event-details-group/workflow-history-event-details-group' ;
45import { type WorkflowPageParams } from '@/views/workflow-page/workflow-page.types' ;
56
6- import WorkflowHistoryGroupDetailsJson from '../workflow-history-group-details-json/workflow-history-group-details-json' ;
7-
87import { styled } from './workflow-history-event-details.styles' ;
9- import {
10- type EventDetailsEntries ,
11- type EventDetailsSingleEntry ,
12- } from './workflow-history-event-details.types' ;
8+ import { type EventDetailsEntries } from './workflow-history-event-details.types' ;
139
1410export default function WorkflowHistoryEventDetails ( {
1511 eventDetails,
@@ -20,9 +16,7 @@ export default function WorkflowHistoryEventDetails({
2016} ) {
2117 const [ panelDetails , restDetails ] = useMemo (
2218 ( ) =>
23- eventDetails . reduce <
24- [ Array < EventDetailsSingleEntry > , EventDetailsEntries ]
25- > (
19+ eventDetails . reduce < [ EventDetailsEntries , EventDetailsEntries ] > (
2620 ( [ panels , rest ] , entry ) => {
2721 if ( entry . renderConfig ?. showInPanels && ! entry . isGroup ) {
2822 panels . push ( entry ) ;
@@ -45,16 +39,30 @@ export default function WorkflowHistoryEventDetails({
4539 < styled . EventDetailsContainer >
4640 { panelDetails . length > 0 && (
4741 < styled . PanelDetails >
48- { panelDetails . map ( ( detail ) => (
49- < styled . PanelContainer key = { detail . path } >
50- < WorkflowHistoryGroupDetailsJson
51- entryPath = { detail . path }
52- entryValue = { detail . value }
53- isNegative = { detail . isNegative }
54- { ...workflowPageParams }
55- />
56- </ styled . PanelContainer >
57- ) ) }
42+ { panelDetails . map ( ( detail ) => {
43+ return (
44+ < styled . PanelContainer key = { detail . path } >
45+ { ! detail . isGroup ? (
46+ < WorkflowHistoryEventDetailsEntry
47+ entryKey = { detail . key }
48+ entryPath = { detail . path }
49+ entryValue = { detail . value }
50+ isNegative = { detail . isNegative }
51+ renderConfig = { detail . renderConfig }
52+ { ...workflowPageParams }
53+ />
54+ ) : (
55+ < WorkflowHistoryEventDetailsGroup
56+ entries = { restDetails }
57+ decodedPageUrlParams = { {
58+ ...workflowPageParams ,
59+ workflowTab : 'history' ,
60+ } }
61+ />
62+ ) }
63+ </ styled . PanelContainer >
64+ ) ;
65+ } ) }
5866 </ styled . PanelDetails >
5967 ) }
6068 < styled . RestDetails >
0 commit comments