11"use client" ;
22
3+ import { useState } from "react" ;
34import { useEventsStore } from "@/stores/events-store" ;
45import { useAuthStore } from "@/stores/auth-store" ;
56import { ScrollArea } from "@/components/ui/scroll-area" ;
7+ import { Button } from "@/components/ui/button" ;
68import { EventCard } from "./event-card" ;
79import { FeedFilters } from "./feed-filters" ;
10+ import { SignInModal } from "@/components/auth" ;
811import { Loader2 , Lock } from "lucide-react" ;
912
1013const APP_MODE = process . env . NEXT_PUBLIC_APP_MODE || "self-hosted" ;
@@ -13,6 +16,7 @@ export function EventFeed() {
1316 const { filteredEvents, isLoading, error, selectedEvent, selectEvent } =
1417 useEventsStore ( ) ;
1518 const { isAuthenticated } = useAuthStore ( ) ;
19+ const [ showSignInModal , setShowSignInModal ] = useState ( false ) ;
1620
1721 const requiresAuth = APP_MODE === "valyu" ;
1822 const showSignInPrompt = requiresAuth && ! isAuthenticated && ! isLoading && filteredEvents . length === 0 ;
@@ -50,9 +54,16 @@ export function EventFeed() {
5054 < p className = "text-sm font-medium text-foreground mb-1" >
5155 Sign in to view events
5256 </ p >
53- < p className = "text-xs text-muted-foreground" >
57+ < p className = "text-xs text-muted-foreground mb-4 " >
5458 Events require authentication
5559 </ p >
60+ < Button
61+ variant = "outline"
62+ size = "sm"
63+ onClick = { ( ) => setShowSignInModal ( true ) }
64+ >
65+ Sign in
66+ </ Button >
5667 </ div >
5768 ) }
5869
@@ -76,6 +87,8 @@ export function EventFeed() {
7687 ) ) }
7788 </ div >
7889 </ ScrollArea >
90+
91+ < SignInModal open = { showSignInModal } onOpenChange = { setShowSignInModal } />
7992 </ div >
8093 ) ;
8194}
0 commit comments