Skip to content

Commit daa3938

Browse files
committed
fix: handle undefined likes in poster-horizontal
- Replace Typography with TextMaxLine for likes display, ensuring it handles undefined likes gracefully by defaulting to 0. - Adjust line clamping behavior for improved visual consistency.
1 parent acc4dd0 commit daa3938

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/poster/variants/poster-horizontal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ const PosterHorizontal = ({ title, images, likes, id, synopsis }: Poster) => {
7171
<Box sx={{display:'flex',alignItems:'center',justifyContent: 'space-between'}}>
7272
<Stack direction="row" spacing={0.5} alignItems='center' textAlign='center'>
7373
<IconHeartFilled style={{marginBottom:'2px'}} size={16} color="#F2F3F5" />
74-
<Typography style={{fontSize: 'clamp(0.1rem, 0.8vw, 0.9rem)', fontWeight: '700', whiteSpace: 'nowrap'}} variant="body2">
75-
{formatLikes(likes)}
76-
</Typography>
74+
<TextMaxLine line={1} variant="body2">
75+
{formatLikes(likes ?? 0)}
76+
</TextMaxLine>
7777
</Stack>
7878
</Box>
7979
</Box>

0 commit comments

Comments
 (0)