initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
'use client'
|
||||
|
||||
// MUI Imports
|
||||
import MuiBadge from '@mui/material/Badge'
|
||||
import type { BadgeProps } from '@mui/material/Badge'
|
||||
import { styled } from '@mui/material/styles'
|
||||
|
||||
export type CustomBadgeProps = BadgeProps & {
|
||||
tonal?: 'true' | 'false'
|
||||
}
|
||||
|
||||
const Badge = styled(MuiBadge)<CustomBadgeProps>(({ tonal, color }) => {
|
||||
return {
|
||||
...(tonal === 'true' && {
|
||||
'& .MuiBadge-badge.MuiBadge-standard': {
|
||||
color: `var(--mui-palette-${color}-main)`,
|
||||
backgroundColor: `var(--mui-palette-${color}-lightOpacity)`
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const CustomBadge = (props: CustomBadgeProps) => <Badge {...props} />
|
||||
|
||||
export default CustomBadge
|
||||
Reference in New Issue
Block a user