worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
31
node_modules/@mui/material/esm/Badge/useBadge.js
generated
vendored
Normal file
31
node_modules/@mui/material/esm/Badge/useBadge.js
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
'use client';
|
||||
|
||||
import usePreviousProps from '@mui/utils/usePreviousProps';
|
||||
function useBadge(parameters) {
|
||||
const {
|
||||
badgeContent: badgeContentProp,
|
||||
invisible: invisibleProp = false,
|
||||
max: maxProp = 99,
|
||||
showZero = false
|
||||
} = parameters;
|
||||
const prevProps = usePreviousProps({
|
||||
badgeContent: badgeContentProp,
|
||||
max: maxProp
|
||||
});
|
||||
let invisible = invisibleProp;
|
||||
if (invisibleProp === false && badgeContentProp === 0 && !showZero) {
|
||||
invisible = true;
|
||||
}
|
||||
const {
|
||||
badgeContent,
|
||||
max = maxProp
|
||||
} = invisible ? prevProps : parameters;
|
||||
const displayValue = badgeContent && Number(badgeContent) > max ? `${max}+` : badgeContent;
|
||||
return {
|
||||
badgeContent,
|
||||
invisible,
|
||||
max,
|
||||
displayValue
|
||||
};
|
||||
}
|
||||
export default useBadge;
|
||||
Loading…
Add table
Add a link
Reference in a new issue