This repository was archived by the owner on Apr 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import type { FC , CSSProperties , ReactNode } from 'react' ;
2
+ import type { FC , CSSProperties } from 'react' ;
3
3
import cls from 'classnames' ;
4
4
5
5
import Stage from './Stages' ;
@@ -47,13 +47,13 @@ const JourneyMap: FC<JourneyMapProps> = ({
47
47
} ) => {
48
48
const store = useJourneyMap ( { data, onChange, title, config } ) ;
49
49
50
- const sections : Record < SectionType , ReactNode > = {
51
- action : < Actions /> ,
52
- stage : < Stage /> ,
53
- emotion : < Chart /> ,
54
- thought : < Thoughts /> ,
55
- chance : < div /> ,
56
- painSpot : < div /> ,
50
+ const sections : Record < SectionType , FC > = {
51
+ action : Actions ,
52
+ stage : Stage ,
53
+ emotion : Chart ,
54
+ thought : Thoughts ,
55
+ chance : ( ) => < div /> ,
56
+ painSpot : ( ) => < div /> ,
57
57
} ;
58
58
59
59
const arrange = store . config ?. arrange || [
@@ -73,7 +73,10 @@ const JourneyMap: FC<JourneyMapProps> = ({
73
73
< div className = "avx-journey-map-title" > { store . title } </ div >
74
74
) : null }
75
75
< div className = "avx-journey-map-content" >
76
- { arrange . map ( ( a ) => sections [ a ] ) }
76
+ { arrange . map ( ( a ) => {
77
+ const Section = sections [ a ] ;
78
+ return < Section key = { a } /> ;
79
+ } ) }
77
80
</ div >
78
81
</ div >
79
82
</ JourneyMapStore . Provider >
You can’t perform that action at this time.
0 commit comments