@@ -15,6 +15,7 @@ export const SimpleTwoActionsDialog = ({
1515 button1Props,
1616 button2Props,
1717 closeOnBackdropClick,
18+ component,
1819} ) => {
1920 const onClose = ( event , reason ) => {
2021 if ( closeOnBackdropClick || reason !== 'backdropClick' ) {
@@ -33,7 +34,9 @@ export const SimpleTwoActionsDialog = ({
3334 >
3435 < DialogTitle id = { id + '-dialog-title' } > { labels . title } </ DialogTitle >
3536 < DialogContent >
36- < Typography variant = "body1" > { labels . body } </ Typography >
37+ < Typography variant = "body1" component = { component } >
38+ { labels . body }
39+ </ Typography >
3740 </ DialogContent >
3841 < DialogActions >
3942 < Button
@@ -84,7 +87,7 @@ SimpleTwoActionsDialog.propTypes = {
8487 */
8588 labels : PropTypes . shape ( {
8689 title : PropTypes . string . isRequired ,
87- body : PropTypes . string . isRequired ,
90+ body : PropTypes . node . isRequired ,
8891 button1 : PropTypes . string . isRequired ,
8992 button2 : PropTypes . string . isRequired ,
9093 } ) ,
@@ -117,6 +120,10 @@ SimpleTwoActionsDialog.propTypes = {
117120 * Close dialog on backdrop click
118121 */
119122 closeOnBackdropClick : PropTypes . bool ,
123+ /**
124+ * HTML tag to be rendered as dialog's body, e.g., 'div', 'span', 'p' (default value)
125+ */
126+ component : PropTypes . string ,
120127} ;
121128
122129SimpleTwoActionsDialog . defaultProps = {
@@ -139,4 +146,5 @@ SimpleTwoActionsDialog.defaultProps = {
139146 button1Props : { } ,
140147 button2Props : { } ,
141148 closeOnBackdropClick : false ,
149+ component : 'p' ,
142150} ;
0 commit comments