Spaces:
Running
Running
Download src/components/events/EventLog.tsx from evalstate/mcp-webcam: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/spaces/evalstate/mcp-webcam/resolve/main/src/components/events/EventLog.tsx
- Command line
-
hf download hf://spaces/evalstate/mcp-webcam/src/components/events/EventLog.tsx
-
curl -L -o EventLog.tsx https://huggingface.co/spaces/evalstate/mcp-webcam/resolve/main/src/components/events/EventLog.tsx
1.29 kB
| import { useState } from 'react'; | |
| import { Sparkles } from 'lucide-react'; | |
| import type { EventLogEntry } from '../../../shared/api-types'; | |
| import { EmptyState } from '@/components/ui/empty-state'; | |
| import { ScreenTestDialog } from '@/components/stage/ScreenTestDialog'; | |
| import { EventRow } from './EventRow'; | |
| export function EventLog({ events }: { events: EventLogEntry[] }) { | |
| const [preview, setPreview] = useState<{ title: string; subtitle: string; url: string } | null>(null); | |
| if (events.length === 0) { | |
| return ( | |
| <EmptyState | |
| icon={<Sparkles className="h-5 w-5" />} | |
| title="No events fired yet" | |
| description="Use the Fire MCP Event panel on the left to emit webcam.message or webcam.snapshot events." | |
| /> | |
| ); | |
| } | |
| return ( | |
| <> | |
| <div className="space-y-2"> | |
| {events.map((entry) => ( | |
| <EventRow | |
| key={entry.eventId} | |
| entry={entry} | |
| onPreviewImage={(title, subtitle, url) => setPreview({ title, subtitle, url })} | |
| /> | |
| ))} | |
| </div> | |
| <ScreenTestDialog | |
| open={Boolean(preview)} | |
| title={preview?.title ?? ''} | |
| subtitle={preview?.subtitle} | |
| imageUrl={preview?.url ?? null} | |
| onClose={() => setPreview(null)} | |
| /> | |
| </> | |
| ); | |
| } | |