MessagesTable() — supabase Function Reference
Architecture documentation for the MessagesTable() function in MessagesTable.tsx from the supabase codebase.
Entity Profile
Dependency Diagram
graph TD cf9ba0fd_9d82_fc11_3396_c202a0bd46d5["MessagesTable()"] 0c9653e6_f7de_8f5e_bf6a_adba8399013f["isErrorLog()"] cf9ba0fd_9d82_fc11_3396_c202a0bd46d5 -->|calls| 0c9653e6_f7de_8f5e_bf6a_adba8399013f style cf9ba0fd_9d82_fc11_3396_c202a0bd46d5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/studio/components/interfaces/Realtime/Inspector/MessagesTable.tsx lines 118–228
const MessagesTable = ({
enabled,
hasChannelSet,
data = [],
showSendMessage,
}: MessagesTableProps) => {
const [focusedLog, setFocusedLog] = useState<LogData | null>(null)
const stringData = JSON.stringify(data)
const { ref } = useParams()
const { data: org } = useSelectedOrganizationQuery()
const { mutate: sendEvent } = useSendEventMutation()
useEffect(() => {
if (!data) return
const found = data.find((datum) => datum.id === focusedLog?.id)
if (!found) {
setFocusedLog(null)
}
}, [stringData])
if (!data) return null
return (
<>
<section className="flex w-full flex-col" style={{ maxHeight: 'calc(100vh - 42px - 3rem)' }}>
<ShimmerLine active={enabled} />
<div className={cn('flex h-full flex-row', enabled ? 'border-brand-400' : null)}>
<div className="flex flex-grow flex-col">
{enabled && (
<div className="w-full h-9 px-4 bg-surface-100 border-b items-center inline-flex justify-between text-foreground-light">
<div className="inline-flex gap-2.5 text-xs">
<Loader2 size="16" className="animate-spin" />
<div>Listening</div>
<div>•</div>
<div>
{data.length > 0
? data.length >= 100
? `Found a large number of messages, showing only the latest 100...`
: `Found ${data.length} messages...`
: `No message found yet...`}
</div>
</div>
<Button
type="default"
onClick={showSendMessage}
icon={<Megaphone strokeWidth={1.5} />}
>
<span>Broadcast a message</span>
</Button>
</div>
)}
<DataGrid
className="data-grid--simple-logs h-full border-b-0"
rowHeight={40}
headerRowHeight={0}
columns={ColumnRenderer}
rowClass={(row) => {
return cn([
'font-mono tracking-tight',
isEqual(row, focusedLog)
? 'bg-scale-800 rdg-row--focused'
: 'bg-200 hover:bg-scale-300 cursor-pointer',
isErrorLog(row) && '!bg-warning-300',
])
}}
rows={data}
rowKeyGetter={(row) => row.id}
renderers={{
renderRow(idx, props) {
const { row } = props
return (
<Row
key={idx}
{...props}
isRowSelected={false}
selectedCellIdx={undefined}
onClick={() => {
sendEvent({
action: 'realtime_inspector_message_clicked',
groups: {
project: ref ?? 'Unknown',
organization: org?.slug ?? 'Unknown',
},
})
setFocusedLog(row)
}}
/>
)
},
noRowsFallback: (
<div className="mx-auto flex h-full w-full items-center justify-center space-y-12 py-4 transition-all delay-200 duration-500">
<NoResultAlert
enabled={enabled}
hasChannelSet={hasChannelSet}
showSendMessage={showSendMessage}
/>
</div>
),
}}
/>
</div>
<div className="flex w-1/2 flex-col">
<MessageSelection onClose={() => setFocusedLog(null)} log={focusedLog} />
</div>
</div>
</section>
</>
)
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does MessagesTable() do?
MessagesTable() is a function in the supabase codebase.
What does MessagesTable() call?
MessagesTable() calls 1 function(s): isErrorLog.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free