Skip to content

Commit 2327020

Browse files
authored
fix(library): update file type handling and badge properties on LibraryCardEmbed
- Improved file type determination by using `capitalize` for asset file extensions. - Updated `Badge` component to disable hover effect for better UI consistency. ---- Ref: #678 Reviewed-by: @johan-fx
1 parent 977e717 commit 2327020

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/leemons-plugin-leebrary/frontend/src/components/LibraryCardEmbed/LibraryCardEmbed.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const LibraryCardEmbed = ({
109109
document: asset?.fileExtension === 'pdf' ? 'PDF' : 'Document',
110110
};
111111

112-
return typeMappings[fileType] || 'Media';
112+
return typeMappings[fileType] ?? capitalize(asset?.fileExtension ?? fileType ?? 'Media');
113113
};
114114

115115
const renderVariantIcon = () => {
@@ -156,7 +156,7 @@ const LibraryCardEmbed = ({
156156
</Text>
157157
</TextClamp>
158158
</Stack>
159-
<Badge size="xs" label={badgeCategory} closable={false} radius={'default'} />
159+
<Badge size="xs" label={badgeCategory} closable={false} radius={'default'} disableHover />
160160
</Stack>
161161
<Box noFlex className={classes.variantIcon}>
162162
{hasActionButton && renderVariantIcon()}

0 commit comments

Comments
 (0)