Skip to content

Commit

Permalink
feat: no media available tip in picture item
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Aug 1, 2024
1 parent 0d4c70d commit 58d9b3b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
32 changes: 20 additions & 12 deletions src/renderer/src/modules/entry-column/picture-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,26 @@ export function PictureItem({
translation={translation}
>
<div className="relative flex gap-2 overflow-x-auto">
<SwipeMedia
media={entry.entries.media}
className={cn(
"aspect-square w-full shrink-0 rounded-md",
isActive && "rounded-b-none",
)}
imgClassName="object-cover"
uniqueKey={entryId}
onPreview={(media, i) => {
previewMedia(media, i)
}}
/>
{entry.entries.media ? (
<SwipeMedia
media={entry.entries.media}
className={cn(
"aspect-square w-full shrink-0 rounded-md",
isActive && "rounded-b-none",
)}
imgClassName="object-cover"
uniqueKey={entryId}
onPreview={(media, i) => {
previewMedia(media, i)
}}
/>
) : (
<div className="center aspect-square w-full flex-col gap-1 bg-muted text-xs text-muted-foreground">
<i className="i-mgc-sad-cute-re size-6" />
No media available
</div>
)}

</div>
</GridItem>
)
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/modules/entry-column/video-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function VideoItem({
(
<div className="center aspect-video w-full flex-col gap-1 bg-muted text-xs text-muted-foreground">
<i className="i-mgc-sad-cute-re size-6" />
No video available
No media available
</div>
)}
</div>
Expand Down

0 comments on commit 58d9b3b

Please sign in to comment.