Files
t3code/apps/web/src/components/chat/DiffStatLabel.tsx
T
Julius Marminge 973ab3232f Refine appearance theme token handling
- Apply theme overrides as inline CSS variables
- Add diff-specific tokens and color-blind diff palette
- Update swatches and diff stats to use new semantic colors
2026-03-29 13:48:29 -07:00

23 lines
768 B
TypeScript

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 && <span className="text-muted-foreground/70">(</span>}
<span className="text-diff-addition">+{additions}</span>
<span className="mx-0.5 text-muted-foreground/70">/</span>
<span className="text-diff-deletion">-{deletions}</span>
{showParentheses && <span className="text-muted-foreground/70">)</span>}
</>
);
});