mirror of
https://github.com/supabase/supabase.git
synced 2026-05-13 04:08:16 -04:00
4a0bb36ca8
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { Column } from 'react-data-grid'
|
|
import { TimestampInfo } from 'ui-patterns/TimestampInfo'
|
|
|
|
import type { LogData } from '../Logs.types'
|
|
import { RowLayout, SeverityFormatter, TextFormatter } from '../LogsFormatters'
|
|
import { defaultRenderCell } from './DefaultPreviewColumnRenderer'
|
|
|
|
const columns: Column<LogData>[] = [
|
|
{
|
|
name: 'functions-logs-first-column',
|
|
key: 'functions-logs-first-column',
|
|
renderHeaderCell: () => null,
|
|
renderCell: (props) => {
|
|
if (!props.row.event_type && !props.row.level) {
|
|
return defaultRenderCell(props)
|
|
}
|
|
return (
|
|
<RowLayout>
|
|
<TimestampInfo utcTimestamp={props.row.timestamp!} />
|
|
{props.row.event_type === 'uncaughtException' ? (
|
|
<SeverityFormatter value={props.row.event_type} uppercase={false} />
|
|
) : (
|
|
<SeverityFormatter value={props.row.level as string} />
|
|
)}
|
|
<TextFormatter className="w-full" value={props.row.event_message} />
|
|
</RowLayout>
|
|
)
|
|
},
|
|
},
|
|
]
|
|
|
|
export default columns
|