14
14
* limitations under the License.
15
15
*/
16
16
17
+ import { ReactNode } from 'react'
17
18
import { ComponentSizeType } from '@Shared/constants'
18
19
import { Progressing } from '@Common/Progressing'
19
- import { ReactComponent as ErrorIcon } from '../../../Assets/Icon/ic-error-exclamation.svg'
20
- import { ReactComponent as ICInfoOutline } from '../../../Assets/Icon/ic-info-outline.svg'
20
+ import { ReactComponent as ErrorIcon } from '@Icons/ic-error-exclamation.svg'
21
+ import { ReactComponent as ICInfoOutline } from '@Icons/ic-info-outline.svg'
22
+ import { ReactComponent as ICArrowCounterClockwise } from '@Icons/ic-arrow-counter-clockwise.svg'
21
23
import { Button , ButtonVariantType } from '../Button'
22
24
import { GenericSectionErrorStateProps } from './types'
23
25
@@ -44,6 +46,18 @@ const GenericSectionErrorState = ({
44
46
return < ErrorIcon className = "icon-dim-24 alert-icon-r5-imp" />
45
47
}
46
48
49
+ const renderSubHeading = ( content : ReactNode ) => {
50
+ if ( ! content ) {
51
+ return null
52
+ }
53
+
54
+ if ( typeof content === 'string' ) {
55
+ return < p className = "m-0 dc__truncate--clamp-6" > { content } </ p >
56
+ }
57
+
58
+ return content
59
+ }
60
+
47
61
return (
48
62
< div className = { `flex column dc__gap-8 p-16 ${ withBorder ? 'dc__border br-4' : '' } ${ rootClassName || '' } ` } >
49
63
{ renderMarker ( ) }
@@ -52,14 +66,15 @@ const GenericSectionErrorState = ({
52
66
< h3 className = "fs-13 lh-20 fw-6 cn-9 m-0" > { title } </ h3 >
53
67
{ ( subTitle || description ) && (
54
68
< div className = "flex column fs-13 lh-20 fw-4 cn-7" >
55
- { subTitle && < p className = "m-0" > { subTitle } </ p > }
56
- { description && < p className = "m-0" > { description } </ p > }
69
+ { renderSubHeading ( subTitle ) }
70
+ { renderSubHeading ( description ) }
57
71
</ div >
58
72
) }
59
73
</ div >
60
74
61
75
{ reload && (
62
76
< Button
77
+ startIcon = { < ICArrowCounterClockwise className = "dc__flip" /> }
63
78
text = { buttonText }
64
79
onClick = { reload }
65
80
variant = { ButtonVariantType . text }
0 commit comments