File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
client/src/components/book Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,18 @@ class List extends Component {
34
34
this . props . reset ( this . props . eventSource ) ;
35
35
}
36
36
37
+ renderLinks = ( type , items ) => {
38
+ if ( Array . isArray ( items ) ) {
39
+ return items . map ( ( item , i ) => (
40
+ < div key = { i } > { this . renderLinks ( type , item ) } </ div >
41
+ ) ) ;
42
+ }
43
+
44
+ return (
45
+ < Link to = { `../${ type } /show/${ encodeURIComponent ( items ) } ` } > { items } </ Link >
46
+ ) ;
47
+ } ;
48
+
37
49
render ( ) {
38
50
return (
39
51
< div >
@@ -66,6 +78,7 @@ class List extends Component {
66
78
< th > description</ th >
67
79
< th > author</ th >
68
80
< th > publicationDate</ th >
81
+ < th > reviews</ th >
69
82
< th colSpan = { 2 } />
70
83
</ tr >
71
84
</ thead >
@@ -83,6 +96,7 @@ class List extends Component {
83
96
< td > { item [ 'description' ] } </ td >
84
97
< td > { item [ 'author' ] } </ td >
85
98
< td > { item [ 'publicationDate' ] } </ td >
99
+ < td > { this . renderLinks ( 'reviews' , item [ 'reviews' ] ) } </ td >
86
100
< td >
87
101
< Link to = { `show/${ encodeURIComponent ( item [ '@id' ] ) } ` } >
88
102
< span className = "fa fa-search" aria-hidden = "true" />
You can’t perform that action at this time.
0 commit comments