Skip to content

Commit c036ce4

Browse files
committed
chore: code review
1 parent 24a6e99 commit c036ce4

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

src/platform/assets/components/MediaAssetCard.vue

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@
1111
: $t('assetBrowser.ariaLabel.loadingAsset')
1212
"
1313
:tabindex="loading ? -1 : 0"
14-
:class="containerClasses"
14+
:class="
15+
cn(
16+
'flex flex-col overflow-hidden aspect-[100/120] cursor-pointer p-2 transition-colors duration-200 rounded-lg',
17+
'gap-1 select-none group',
18+
selected
19+
? 'ring-3 ring-inset ring-modal-card-border-highlighted'
20+
: 'hover:bg-modal-card-background-hovered'
21+
)
22+
"
1523
:data-selected="selected"
1624
@click.stop="$emit('click')"
1725
@contextmenu.prevent="handleContextMenu"
@@ -237,17 +245,6 @@ provide(MediaAssetKey, {
237245
showVideoControls
238246
})
239247
240-
const containerClasses = computed(() =>
241-
cn(
242-
// Base styles from CardContainer (mini + ghost variant)
243-
'flex flex-col overflow-hidden aspect-[100/120] cursor-pointer p-2 transition-colors duration-200 rounded-lg',
244-
'gap-1 select-none group',
245-
selected
246-
? 'ring-3 ring-inset ring-modal-card-border-highlighted'
247-
: 'hover:bg-modal-card-background-hovered'
248-
)
249-
)
250-
251248
const formattedDuration = computed(() => {
252249
// Check for execution time first (from history API)
253250
const executionTime = asset?.user_metadata?.executionTimeInSeconds
@@ -273,11 +270,10 @@ const metaInfo = computed(() => {
273270
return ''
274271
})
275272
276-
// Show action overlay when hovered OR selected OR playing
277-
const showActionsOverlay = computed(
278-
() =>
279-
!loading && !!asset && (isHovered.value || selected || isVideoPlaying.value)
280-
)
273+
const showActionsOverlay = computed(() => {
274+
if (loading || !asset) return false
275+
return isHovered.value || selected || isVideoPlaying.value
276+
})
281277
282278
const handleZoomClick = () => {
283279
if (asset) {

0 commit comments

Comments
 (0)