import { memo } from "react";
export function hasNonZeroStat(stat: { additions: number; deletions: number }): boolean {
return stat.additions > 0 || stat.deletions > 0;
}
export const DiffStatLabel = memo(function DiffStatLabel(props: {
additions: number;
deletions: number;
showParentheses?: boolean;
}) {
const { additions, deletions, showParentheses = false } = props;
return (
<>
{showParentheses && (}
+{additions}
/
-{deletions}
{showParentheses && )}
>
);
});