Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: list item key error

Marc Seitzf03fa3a5087a
diff --git a/components/documents/stats-card.tsx b/components/documents/stats-card.tsx
index d1765698..3ff163cf 100644
--- a/components/documents/stats-card.tsx
+++ b/components/documents/stats-card.tsx
@@ -37,7 +37,7 @@ export default function StatsCard() {
<StatsElement key={statIdx} stat={stat} statIdx={statIdx} />
))
: Array.from({ length: 4 }).map((_, i) => (
- <StatsElementPlaceholder key={i} />
+ <StatsElementPlaceholder key={i} statIdx={i} />
))}
</div>
);
diff --git a/components/documents/stats-element-placeholder.tsx b/components/documents/stats-element-placeholder.tsx
index 6d012855..6b0edfe3 100644
--- a/components/documents/stats-element-placeholder.tsx
+++ b/components/documents/stats-element-placeholder.tsx
@@ -1,10 +1,10 @@
import { classNames } from "@/lib/utils";
-export default function StatsElementPlaceholder({ key }: { key: number }) {
+export default function StatsElementPlaceholder({ statIdx }: { statIdx: number }) {
return (
<div
className={classNames(
- key % 2 === 1 ? "sm:border-l" : key === 2 ? "lg:border-l" : "",
+ statIdx % 2 === 1 ? "sm:border-l" : statIdx === 2 ? "lg:border-l" : "",
"border-t border-white/5 py-6 px-4 sm:px-6 lg:px-8"
)}
>