Skip to content

Commit 25b7528

Browse files
committed
duplicate code componeent
1 parent fb185d8 commit 25b7528

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React from 'react';
2+
import { styles } from '../utils/styles';
3+
4+
interface Props {
5+
percentage?: number;
6+
blocks?: number;
7+
lines?: number;
8+
}
9+
10+
export const DuplicateCodeCard: React.FC<Props> = ({
11+
percentage = 0,
12+
blocks,
13+
lines,
14+
}) => {
15+
return (
16+
<div style={styles.metricCard} className="metric-card">
17+
<div style={styles.metricHeader}>
18+
<h3 style={styles.metricTitle}>Duplicate Code</h3>
19+
<span style={styles.metricValue}>{percentage.toFixed(2)}%</span>
20+
</div>
21+
22+
<div style={styles.metricDetails}>
23+
{blocks !== undefined && (
24+
<p style={styles.detailLine}>Duplicate blocks: {blocks}</p>
25+
)}
26+
{lines !== undefined && (
27+
<p style={styles.detailLine}>Duplicate lines: {lines}</p>
28+
)}
29+
</div>
30+
</div>
31+
);
32+
};

0 commit comments

Comments
 (0)