@@ -11,11 +11,12 @@ export const ErrorBanner = (props) => {
1111 navigator . clipboard . writeText ( message ) . then ( ( ) => setCopyButtonText ( labels . toggledButtonText ) ) ;
1212 } ;
1313 const errorMessageMaxLength = 200 ;
14+ const errorStatusText = error . status ? error . status + ' ' : '' ;
1415 return (
1516 < Slide direction = "down" in = { error != null } unmountOnExit >
1617 < Paper square elevation = { 0 } className = { classes . errorContainer } data-cy = "error-banner" >
1718 < div >
18- < Typography className = { classes . errorTitle } > { error . status + ' ' + error . title } </ Typography >
19+ < Typography className = { classes . errorTitle } > { errorStatusText + error . title } </ Typography >
1920 < Typography className = { classes . errorText } >
2021 { error . detail . length < errorMessageMaxLength ? error . detail : labels . tooLongErrorMessage }
2122 </ Typography >
@@ -52,7 +53,12 @@ export const ErrorBanner = (props) => {
5253} ;
5354
5455ErrorBanner . propTypes = {
55- error : PropTypes . object . isRequired ,
56+ error : PropTypes . shape ( {
57+ comment : PropTypes . string ,
58+ detail : PropTypes . string ,
59+ status : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . number ] ) ,
60+ title : PropTypes . string . isRequired ,
61+ } ) . isRequired ,
5662 clearErrors : PropTypes . func ,
5763 labels : PropTypes . shape ( {
5864 tooLongErrorMessage : PropTypes . string ,
0 commit comments