import { Link } from '@tanstack/react-router' import { AiIconAnimation, Button, Card, cn } from 'ui' import { SuspensionNotice } from '../../Settings/SuspensionNotice' import { AnimatedCursors } from './AnimatedCursors' import { SIDEBAR_KEYS } from '@/components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider' import { DocsButton } from '@/components/ui/DocsButton' import { useRealtimeConfigurationQuery } from '@/data/realtime/realtime-config-query' import { DOCS_URL } from '@/lib/constants' import { useAiAssistantStateSnapshot } from '@/state/ai-assistant-state' import { useSidebarManagerSnapshot } from '@/state/sidebar-manager-state' /** * Acts as a container component for the entire log display */ export const EmptyRealtime = ({ projectRef }: { projectRef: string }) => { const aiSnap = useAiAssistantStateSnapshot() const { openSidebar } = useSidebarManagerSnapshot() const { data } = useRealtimeConfigurationQuery({ projectRef }) const isSuspended = Boolean(data?.admin_suspended_at) const handleCreateTriggerWithAssistant = () => { openSidebar(SIDEBAR_KEYS.AI_ASSISTANT) aiSnap.newChat({ name: `Realtime`, initialInput: `Help me set up a realtime experience for my project`, }) } return (

Create realtime experiences

Send your first realtime message from your database, application code or edge function

{!isSuspended && ( )}
{isSuspended && }
1

Broadcast messages

Send messages to a channel from your client application or database via triggers.

2

Write policies

Set up Row Level Security policies to control who can see messages within a channel

3

Subscribe to a channel

Receive realtime messages in your application by listening to a channel

) }