import type { NostrLink, TaggedNostrEvent } from "@snort/system" import { Helmet } from "@dr.pogodin/react-helmet" import { Suspense, lazy } from "react" import { useMediaQuery } from "usehooks-ts" const LiveVideoPlayer = lazy(() => import("@/element/stream/live-video-player")) import { getHost } from "@/utils" import { LiveChat } from "@/element/chat/live-chat" import { StreamCards } from "@/element/stream-cards" import { ContentWarningOverlay, useContentWarning } from "@/element/nsfw" import { LIVE_STREAM, N94_LIVE_STREAM, StreamState } from "@/const" import { StreamInfo } from "@/element/stream/stream-info" import { StreamContextProvider, useStream } from "@/element/stream/stream-state" function StreamPageContent() { const { link, info, event, goal } = useStream() const isDesktop = useMediaQuery("(min-width: 1280px)") const isGrownUp = useContentWarning() if (info?.contentWarning && !isGrownUp) { return } const descriptionContent = [ info?.title, (info?.summary?.length ?? 0) > 0 ? info?.summary : "Nostr live streaming", ...(info?.tags ?? []), ].join(", ") return (
{`${info?.title ?? "Untitled"} - zap.stream`} {link && }
{event?.kind === LIVE_STREAM && link && ( )} {event?.kind === N94_LIVE_STREAM && link && ( )} {event && (
{isDesktop && }
)}
) } export function StreamPage({ link, evPreload }: { evPreload?: TaggedNostrEvent; link: NostrLink }) { return ( ) }