mirror of
https://github.com/supabase/supabase.git
synced 2026-05-12 11:48:38 -04:00
4a0bb36ca8
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
31 lines
1.0 KiB
TypeScript
31 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: 'database-postgres-first-column',
|
|
key: 'database-postgres-first-column',
|
|
renderHeaderCell: () => null,
|
|
renderCell: (props) => {
|
|
if (!props.row.error_severity) {
|
|
return defaultRenderCell(props)
|
|
}
|
|
return (
|
|
<RowLayout>
|
|
<TimestampInfo utcTimestamp={props.row.timestamp!} />
|
|
<SeverityFormatter value={props.row.error_severity as string} />
|
|
<TextFormatter className="w-full" value={props.row.event_message} />
|
|
{props.row.detail ? <TextFormatter value={props.row.detail as string} /> : null}
|
|
{props.row.hint ? <TextFormatter value={props.row.hint as string} /> : null}
|
|
</RowLayout>
|
|
)
|
|
},
|
|
},
|
|
]
|
|
|
|
export default columns
|