fix(dashboard-v2): prevent division by zero
This commit is contained in:
parent
e9c3cfce42
commit
2653de6bb9
|
@ -20,7 +20,7 @@ const BarLabel = styled.span.attrs({
|
|||
`;
|
||||
|
||||
export const GraphBar = ({ value, limit, label }) => {
|
||||
const percentage = (value / limit) * 100;
|
||||
const percentage = typeof limit !== "number" || limit === 0 ? 0 : (value / limit) * 100;
|
||||
|
||||
return (
|
||||
<div className="relative flex items-center">
|
||||
|
|
Reference in New Issue