Skip to content

Commit 42493d0

Browse files
committed
fix: tooltip shows properly if not in progress
1 parent 27feeea commit 42493d0

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/components/StatusBadge/index.tsx

+14-10
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const StatusBadge = ({
9696
}
9797
}
9898

99-
const tooltipContent = downloadItem ? (
99+
const tooltipContent = (
100100
<ul>
101101
{downloadItem.map((status, index) => (
102102
<li
@@ -111,8 +111,6 @@ const StatusBadge = ({
111111
</li>
112112
))}
113113
</ul>
114-
) : (
115-
mediaLinkDescription
116114
);
117115

118116
const badgeDownloadProgress = (
@@ -134,11 +132,13 @@ const StatusBadge = ({
134132
case MediaStatus.AVAILABLE:
135133
return (
136134
<Tooltip
137-
content={inProgress && tooltipContent}
135+
content={inProgress ? tooltipContent : mediaLinkDescription}
138136
className={`${
139137
inProgress && 'hidden max-h-96 w-96 overflow-y-auto sm:block'
140138
}`}
141-
tooltipConfig={{ interactive: true, delayHide: 100 }}
139+
tooltipConfig={{
140+
...(inProgress && { interactive: true, delayHide: 100 }),
141+
}}
142142
>
143143
<Badge
144144
badgeType="success"
@@ -185,11 +185,13 @@ const StatusBadge = ({
185185
case MediaStatus.PARTIALLY_AVAILABLE:
186186
return (
187187
<Tooltip
188-
content={inProgress && tooltipContent}
188+
content={inProgress ? tooltipContent : mediaLinkDescription}
189189
className={`${
190190
inProgress && 'hidden max-h-96 w-96 overflow-y-auto sm:block'
191191
}`}
192-
tooltipConfig={{ interactive: true, delayHide: 100 }}
192+
tooltipConfig={{
193+
...(inProgress && { interactive: true, delayHide: 100 }),
194+
}}
193195
>
194196
<Badge
195197
badgeType="success"
@@ -236,18 +238,20 @@ const StatusBadge = ({
236238
case MediaStatus.PROCESSING:
237239
return (
238240
<Tooltip
239-
content={inProgress && tooltipContent}
241+
content={inProgress ? tooltipContent : mediaLinkDescription}
240242
className={`${
241243
inProgress && 'hidden max-h-96 w-96 overflow-y-auto sm:block'
242244
}`}
243-
tooltipConfig={{ interactive: true, delayHide: 100 }}
245+
tooltipConfig={{
246+
...(inProgress && { interactive: true, delayHide: 100 }),
247+
}}
244248
>
245249
<Badge
246250
badgeType="primary"
247251
href={mediaLink}
248252
className={`${
249253
inProgress &&
250-
'relative !bg-gray-700 !bg-opacity-80 !px-0 hover:!bg-gray-700'
254+
'relative !bg-gray-700 !bg-opacity-80 !px-0 hover:overflow-hidden hover:!bg-gray-700'
251255
} overflow-hidden`}
252256
>
253257
{inProgress && badgeDownloadProgress}

0 commit comments

Comments
 (0)