Skip to content

Commit e5b1974

Browse files
committed
feat: add link to browse events when no bookmarks are found in Bookmarks component
1 parent 7bd8a15 commit e5b1974

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

src/features/bookmarks/Bookmarks.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useState, lazy, Suspense, startTransition } from "react";
2-
import { useSearchParams } from "react-router";
2+
import { Link, useSearchParams } from "react-router";
33
import { getConferenceByCode, getEvents, getTags } from "@/lib/db";
44
import { buildScheduleBucketsByDay } from "@/lib/utils/schedule";
55
import type { GroupedSchedule } from "@/types/ht";
@@ -84,16 +84,29 @@ export function Bookmarks() {
8484
<div className="min-h-dvh flex flex-col">
8585
{conference && <ConferenceHeader conference={conference} />}
8686
<main className="flex-1">
87-
{grouped && confCode ? (
87+
{confCode && grouped && Object.keys(grouped).length > 0 ? (
8888
<Suspense fallback={<LoadingPage message="Loading events..." />}>
8989
<EventsList
9090
dateGroup={grouped}
9191
confCode={confCode}
9292
pageTitle="Bookmarks"
9393
/>
9494
</Suspense>
95-
) : null}
95+
) : (
96+
<div className="flex h-full flex-col items-center justify-center text-center text-gray-400 mt-20">
97+
<p className="text-lg font-medium">No bookmarks found</p>
98+
{confCode && (
99+
<Link
100+
to={`/schedule?conf=${confCode}`}
101+
className="mt-3 inline-block rounded-lg bg-gray-800 px-4 py-2 text-sm font-medium text-gray-200 hover:bg-gray-700 hover:text-white transition"
102+
>
103+
Browse all events
104+
</Link>
105+
)}
106+
</div>
107+
)}
96108
</main>
109+
97110
<HTFooter />
98111
</div>
99112
);

0 commit comments

Comments
 (0)