|
1 | 1 | "use client"; |
2 | 2 |
|
3 | 3 | import { useEventsStore } from "@/stores/events-store"; |
| 4 | +import { useAuthStore } from "@/stores/auth-store"; |
4 | 5 | import { ScrollArea } from "@/components/ui/scroll-area"; |
5 | 6 | import { EventCard } from "./event-card"; |
6 | 7 | import { FeedFilters } from "./feed-filters"; |
7 | | -import { Loader2 } from "lucide-react"; |
| 8 | +import { Loader2, Lock } from "lucide-react"; |
| 9 | + |
| 10 | +const APP_MODE = process.env.NEXT_PUBLIC_APP_MODE || "self-hosted"; |
8 | 11 |
|
9 | 12 | export function EventFeed() { |
10 | | - const { filteredEvents, isLoading, error, selectedEvent, selectEvent } = |
| 13 | + const { filteredEvents, isLoading, error, selectedEvent, selectEvent } = |
11 | 14 | useEventsStore(); |
| 15 | + const { isAuthenticated } = useAuthStore(); |
| 16 | + |
| 17 | + const requiresAuth = APP_MODE === "valyu"; |
| 18 | + const showSignInPrompt = requiresAuth && !isAuthenticated && !isLoading && filteredEvents.length === 0; |
12 | 19 |
|
13 | 20 | return ( |
14 | 21 | <div className="flex h-full flex-col"> |
@@ -37,7 +44,19 @@ export function EventFeed() { |
37 | 44 | </div> |
38 | 45 | )} |
39 | 46 |
|
40 | | - {!isLoading && !error && filteredEvents.length === 0 && ( |
| 47 | + {showSignInPrompt && ( |
| 48 | + <div className="py-8 text-center"> |
| 49 | + <Lock className="mx-auto h-8 w-8 text-muted-foreground/50 mb-3" /> |
| 50 | + <p className="text-sm font-medium text-foreground mb-1"> |
| 51 | + Sign in to view events |
| 52 | + </p> |
| 53 | + <p className="text-xs text-muted-foreground"> |
| 54 | + Events require authentication |
| 55 | + </p> |
| 56 | + </div> |
| 57 | + )} |
| 58 | + |
| 59 | + {!isLoading && !error && !showSignInPrompt && filteredEvents.length === 0 && ( |
41 | 60 | <div className="py-8 text-center"> |
42 | 61 | <p className="text-sm text-muted-foreground"> |
43 | 62 | No events match your filters |
|
0 commit comments