diff options
| author | Mohamed Bassem <me@mbassem.com> | 2024-12-28 12:49:38 +0000 |
|---|---|---|
| committer | Mohamed Bassem <me@mbassem.com> | 2024-12-28 18:16:08 +0000 |
| commit | 98c3c0d5995cbf1f146536cbb03c614b3903d05b (patch) | |
| tree | d38601e362a9826b1a3d99f38fdebf52590676e8 | |
| parent | cf22efab7b309d5068d39f8b7b743b00ef4c6671 (diff) | |
| download | karakeep-98c3c0d5995cbf1f146536cbb03c614b3903d05b.tar.zst | |
fix: react warning about keys in AllHighlights
| -rw-r--r-- | apps/web/components/dashboard/highlights/AllHighlights.tsx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/apps/web/components/dashboard/highlights/AllHighlights.tsx b/apps/web/components/dashboard/highlights/AllHighlights.tsx index 98e17e2b..cbf351de 100644 --- a/apps/web/components/dashboard/highlights/AllHighlights.tsx +++ b/apps/web/components/dashboard/highlights/AllHighlights.tsx @@ -1,6 +1,6 @@ "use client"; -import { useEffect } from "react"; +import React, { useEffect } from "react"; import Link from "next/link"; import { ActionButton } from "@/components/ui/action-button"; import useRelativeTime from "@/lib/hooks/relative-time"; @@ -75,13 +75,10 @@ export default function AllHighlights({ {allHighlights && allHighlights.length > 0 && allHighlights.map((h) => ( - <> - <Highlight key={h.id} highlight={h} /> - <Separator - key={`sep-${h.id}`} - className="m-2 h-0.5 bg-gray-100 last:hidden" - /> - </> + <React.Fragment key={h.id}> + <Highlight highlight={h} /> + <Separator className="m-2 h-0.5 bg-gray-100 last:hidden" /> + </React.Fragment> ))} {allHighlights && allHighlights.length == 0 && ( <p className="rounded-md bg-muted p-2 text-sm text-muted-foreground"> |
