Files
supabase/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsLogsColumnRender.tsx
T
Jordi EnricandJoshen Lim ed69371b76 Update TimestampInfo to accept a UTC timestamp by default (#31167)
* add isUTC support in TimestampInfo

* rm isutc

* rename value prop to utcTimestamp

* Fixy

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-12-18 12:10:56 +08:00

31 lines
1.0 KiB
TypeScript

import { Column } from 'react-data-grid'
import type { LogData } from '../Logs.types'
import { RowLayout, SeverityFormatter, TextFormatter } from '../LogsFormatters'
import { defaultRenderCell } from './DefaultPreviewColumnRenderer'
import { TimestampInfo } from 'ui-patterns/TimestampInfo'
const columns: Column<LogData>[] = [
{
name: 'functions-logs-first-column',
key: 'functions-logs-first-column',
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