@@ -11,39 +11,46 @@ const Reactions: React.FC<{ commonPaths: any; reactions: any }> = ({ commonPaths
1111 } ;
1212 return (
1313 < div >
14- < br />
15- < Typography variant = "h5" > Most frequent reactions</ Typography >
16- < br />
17- < Table >
18- < Table . Head >
19- < Table . Row >
20- < Table . Cell > Reaction</ Table . Cell >
21- < Table . Cell > k</ Table . Cell >
22- < Table . Cell > Frequency</ Table . Cell >
23- </ Table . Row >
24- </ Table . Head >
25- < Table . Body >
26- { Object . keys ( reactions . index )
27- . filter ( ( key ) => Number ( key ) < reactionLimit || ! isReactionsLimited )
28- . map ( ( key , index ) => (
29- < Table . Row key = { index } >
30- < Table . Cell > { convertToSubscripts ( reactions . index [ key ] ) } </ Table . Cell >
31- < Table . Cell > { reactions . k [ key ] } </ Table . Cell >
32- < Table . Cell > { reactions . frequency [ key ] } </ Table . Cell >
14+ < Typography variant = "h5" style = { { marginTop : "1rem" } } >
15+ Most frequent reactions
16+ </ Typography >
17+
18+ { reactions && Object . keys ( reactions ) . length > 0 ? (
19+ < >
20+ < Table >
21+ < Table . Head >
22+ < Table . Row >
23+ < Table . Cell > Reaction</ Table . Cell >
24+ < Table . Cell > k</ Table . Cell >
25+ < Table . Cell > Frequency</ Table . Cell >
3326 </ Table . Row >
34- ) ) }
35- </ Table . Body >
36- </ Table >
37- { Object . keys ( reactions . index ) . length > reactionLimit && (
38- < Button variant = "ghost" onClick = { ( ) => handleShowMoreLessReactions ( ) } >
39- { isReactionsLimited ? "Show more" : "Show less" }
40- </ Button >
27+ </ Table . Head >
28+ < Table . Body >
29+ { Object . keys ( reactions . index )
30+ . filter ( ( key ) => Number ( key ) < reactionLimit || ! isReactionsLimited )
31+ . map ( ( key , index ) => (
32+ < Table . Row key = { index } >
33+ < Table . Cell > { convertToSubscripts ( reactions . index [ key ] ) } </ Table . Cell >
34+ < Table . Cell > { reactions . k [ key ] } </ Table . Cell >
35+ < Table . Cell > { reactions . frequency [ key ] } </ Table . Cell >
36+ </ Table . Row >
37+ ) ) }
38+ </ Table . Body >
39+ </ Table >
40+ { Object . keys ( reactions . index ) . length > reactionLimit && (
41+ < Button variant = "ghost" onClick = { ( ) => handleShowMoreLessReactions ( ) } >
42+ { isReactionsLimited ? "Show more" : "Show less" }
43+ </ Button >
44+ ) }
45+ </ >
46+ ) : (
47+ < Typography > No reactions available.</ Typography >
4148 ) }
42- < br />
43- < br / >
44- < br />
45- < Typography variant = "h5" > Most frequent paths < /Typography >
46- < br />
49+
50+ < Typography variant = "h5" style = { { marginTop : "1rem" } } >
51+ Most frequent paths
52+ </ Typography >
53+
4754 { commonPaths . paths && commonPaths . paths [ 0 ] !== null ? (
4855 < Table >
4956 < Table . Head >
0 commit comments