@@ -11,11 +11,12 @@ export const ErrorBanner = (props) => {
11
11
navigator . clipboard . writeText ( message ) . then ( ( ) => setCopyButtonText ( labels . toggledButtonText ) ) ;
12
12
} ;
13
13
const errorMessageMaxLength = 200 ;
14
+ const errorStatusText = error . status ? error . status + ' ' : '' ;
14
15
return (
15
16
< Slide direction = "down" in = { error != null } unmountOnExit >
16
17
< Paper square elevation = { 0 } className = { classes . errorContainer } data-cy = "error-banner" >
17
18
< div >
18
- < Typography className = { classes . errorTitle } > { error . status + ' ' + error . title } </ Typography >
19
+ < Typography className = { classes . errorTitle } > { errorStatusText + error . title } </ Typography >
19
20
< Typography className = { classes . errorText } >
20
21
{ error . detail . length < errorMessageMaxLength ? error . detail : labels . tooLongErrorMessage }
21
22
</ Typography >
@@ -52,7 +53,12 @@ export const ErrorBanner = (props) => {
52
53
} ;
53
54
54
55
ErrorBanner . 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 ,
56
62
clearErrors : PropTypes . func ,
57
63
labels : PropTypes . shape ( {
58
64
tooLongErrorMessage : PropTypes . string ,
0 commit comments