@@ -2,15 +2,15 @@ import React from 'react';
2
2
import styles from './AggregationPanel.scss' ;
3
3
4
4
// Text Element Component
5
- export const TextElement = ( { text } ) => (
6
- < div className = "text-element" >
5
+ export const TextElement = ( { text, style } ) => (
6
+ < div className = "text-element" style = { style } >
7
7
< p > { text } </ p >
8
8
</ div >
9
9
) ;
10
10
11
11
// Key-Value Element Component
12
- export const KeyValueElement = ( { item, appName } ) => (
13
- < div className = { styles . keyValue } >
12
+ export const KeyValueElement = ( { item, appName, style } ) => (
13
+ < div className = { styles . keyValue } style = { style } >
14
14
{ item . key } :
15
15
{ item . url ? (
16
16
< a href = { item . isRelativeUrl ? `apps/${ appName } /${ item . url } ` : item . url } target = "_blank" rel = "noreferrer" >
@@ -23,8 +23,8 @@ export const KeyValueElement = ({ item, appName }) => (
23
23
) ;
24
24
25
25
// Table Element Component
26
- export const TableElement = ( { columns, rows } ) => (
27
- < div className = "table-element" >
26
+ export const TableElement = ( { columns, rows, style } ) => (
27
+ < div className = "table-element" style = { style } >
28
28
< table >
29
29
< thead >
30
30
< tr >
@@ -47,36 +47,36 @@ export const TableElement = ({ columns, rows }) => (
47
47
) ;
48
48
49
49
// Image Element Component
50
- export const ImageElement = ( { url } ) => (
51
- < div className = "image-element" >
50
+ export const ImageElement = ( { url, style } ) => (
51
+ < div className = "image-element" style = { style } >
52
52
< a href = { url } target = "_blank" rel = "noopener noreferrer" >
53
53
< img src = { url } alt = "Image" className = { styles . image } />
54
54
</ a >
55
55
</ div >
56
56
) ;
57
57
58
58
// Video Element Component
59
- export const VideoElement = ( { url } ) => (
59
+ export const VideoElement = ( { url, style } ) => (
60
60
< div className = "video-element" >
61
- < video controls className = { styles . video } >
61
+ < video controls className = { styles . video } style = { style } >
62
62
< source src = { url } type = "video/mp4" />
63
63
Your browser does not support the video tag.
64
64
</ video >
65
65
</ div >
66
66
) ;
67
67
68
68
// Audio Element Component
69
- export const AudioElement = ( { url } ) => (
69
+ export const AudioElement = ( { url, style } ) => (
70
70
< div className = "audio-element" >
71
- < audio controls className = { styles . audio } >
71
+ < audio controls className = { styles . audio } style = { style } >
72
72
< source src = { url } type = "audio/mpeg" />
73
73
Your browser does not support the audio element.
74
74
</ audio >
75
75
</ div >
76
76
) ;
77
77
78
78
// Button Element Component
79
- export const ButtonElement = ( { item, showNote } ) => {
79
+ export const ButtonElement = ( { item, showNote, style } ) => {
80
80
const handleClick = ( ) => {
81
81
fetch ( item . action . url , {
82
82
method : item . action . method ,
@@ -95,7 +95,7 @@ export const ButtonElement = ({ item, showNote }) => {
95
95
96
96
return (
97
97
< div className = { styles . buttonContainer } >
98
- < button onClick = { handleClick } className = { styles . button } >
98
+ < button onClick = { handleClick } className = { styles . button } style = { style } >
99
99
{ item . text }
100
100
</ button >
101
101
</ div >
0 commit comments