We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b12675 commit 3e138c9Copy full SHA for 3e138c9
src/components/Collapsable.tsx
@@ -1,19 +1,30 @@
1
+import { ComparatorDiff } from "./ComparatorDiff";
2
import "../styles/Collapsable.css";
3
-const Collapsible = ({ details }: any) => {
4
+const Collapsible = (props: any) => {
5
return (
6
<>
7
<details>
8
<summary>Details</summary>
9
<div className="details__wrapper content">
10
<ul>
- {details.map((el: string, i: number) => (
11
- <li key={i}>{el}</li>
12
- ))}
+ {props.details.map((el: string, i: number) =>
+ props.prevDetails && props.prevDetails[i] ? (
13
+ <li key={i}>
14
+ <ComparatorDiff
15
+ previous={props.prevDetails[i]}
16
+ current={el}
17
+ />
18
+ </li>
19
+ ) : (
20
+ <li key={i}>{el}</li>
21
+ ),
22
+ )}
23
</ul>
24
</div>
25
</details>
26
</>
27
);
28
};
29
+
30
export default Collapsible;
0 commit comments