mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
replace old client with new client from commafeed-ui repository
This commit is contained in:
18
commafeed-client/src/components/sidebar/UnreadCount.tsx
Normal file
18
commafeed-client/src/components/sidebar/UnreadCount.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Badge, createStyles } from "@mantine/core"
|
||||
|
||||
const useStyles = createStyles(() => ({
|
||||
badge: {
|
||||
width: "3.2rem",
|
||||
// for some reason, mantine Badge has "cursor: 'default'"
|
||||
cursor: "pointer",
|
||||
},
|
||||
}))
|
||||
|
||||
export function UnreadCount(props: { unreadCount: number }) {
|
||||
const { classes } = useStyles()
|
||||
|
||||
if (props.unreadCount <= 0) return null
|
||||
|
||||
const count = props.unreadCount >= 1000 ? "999+" : props.unreadCount
|
||||
return <Badge className={classes.badge}>{count}</Badge>
|
||||
}
|
||||
Reference in New Issue
Block a user