|
1 | 1 | import { Fragment, useEffect, useRef, useState } from 'react'
|
2 | 2 |
|
| 3 | +import NoAppStatusImage from '@Images/no-artifact.webp' |
3 | 4 | import { abortPreviousRequests, getIsRequestAborted } from '@Common/API'
|
4 | 5 | import { DISCORD_LINK } from '@Common/Constants'
|
5 | 6 | import { Drawer } from '@Common/Drawer'
|
| 7 | +import { GenericEmptyState } from '@Common/EmptyState' |
6 | 8 | import { stopPropagation, useAsync } from '@Common/Helper'
|
7 | 9 | import { ComponentSizeType } from '@Shared/constants'
|
8 | 10 |
|
@@ -111,6 +113,40 @@ const AppStatusModal = ({
|
111 | 113 |
|
112 | 114 | const filteredTitleSegments = (titleSegments || []).filter((segment) => !!segment)
|
113 | 115 |
|
| 116 | + const renderContent = () => { |
| 117 | + if (!appDetails?.resourceTree) { |
| 118 | + return <GenericEmptyState image={NoAppStatusImage} title="Application status is not available" /> |
| 119 | + } |
| 120 | + |
| 121 | + return ( |
| 122 | + <> |
| 123 | + <AppStatusBody |
| 124 | + appDetails={appDetails} |
| 125 | + type={type} |
| 126 | + handleShowConfigDriftModal={handleShowConfigDriftModal} |
| 127 | + /> |
| 128 | + |
| 129 | + {type === 'stack-manager' && ( |
| 130 | + <div className="bg__primary flexbox dc__align-items-center dc__content-space dc__border-top py-16 px-20 fs-13 fw-6"> |
| 131 | + <span className="fs-13 fw-6">Facing issues in installing integration?</span> |
| 132 | + |
| 133 | + <Button |
| 134 | + dataTestId="chat-with-support-button" |
| 135 | + component={ButtonComponentType.anchor} |
| 136 | + anchorProps={{ |
| 137 | + href: DISCORD_LINK, |
| 138 | + target: '_blank', |
| 139 | + rel: 'noreferrer noopener', |
| 140 | + }} |
| 141 | + startIcon={<Icon name="ic-chat-circle-dots" color={null} />} |
| 142 | + text="Chat with support" |
| 143 | + /> |
| 144 | + </div> |
| 145 | + )} |
| 146 | + </> |
| 147 | + ) |
| 148 | + } |
| 149 | + |
114 | 150 | return (
|
115 | 151 | <Drawer position="right" width="1024px" onClose={handleClose} onEscape={handleClose}>
|
116 | 152 | <div
|
@@ -153,29 +189,7 @@ const AppStatusModal = ({
|
153 | 189 | reload: reloadInitialAppDetails,
|
154 | 190 | }}
|
155 | 191 | >
|
156 |
| - <AppStatusBody |
157 |
| - appDetails={appDetails} |
158 |
| - type={type} |
159 |
| - handleShowConfigDriftModal={handleShowConfigDriftModal} |
160 |
| - /> |
161 |
| - |
162 |
| - {type === 'stack-manager' && ( |
163 |
| - <div className="bg__primary flexbox dc__align-items-center dc__content-space dc__border-top py-16 px-20 fs-13 fw-6"> |
164 |
| - <span className="fs-13 fw-6">Facing issues in installing integration?</span> |
165 |
| - |
166 |
| - <Button |
167 |
| - dataTestId="chat-with-support-button" |
168 |
| - component={ButtonComponentType.anchor} |
169 |
| - anchorProps={{ |
170 |
| - href: DISCORD_LINK, |
171 |
| - target: '_blank', |
172 |
| - rel: 'noreferrer noopener', |
173 |
| - }} |
174 |
| - startIcon={<Icon name="ic-chat-circle-dots" color={null} />} |
175 |
| - text="Chat with support" |
176 |
| - /> |
177 |
| - </div> |
178 |
| - )} |
| 192 | + {renderContent()} |
179 | 193 | </APIResponseHandler>
|
180 | 194 | </div>
|
181 | 195 | </div>
|
|
0 commit comments