Files
supabase/apps/studio/components/interfaces/Settings/Logs/LogColumnRenderers/FunctionsLogsColumnRender.tsx
T
Ivan Vasilov 09a62662d8 chore: Clean up ui-patterns imports (#29132)
* Switch all top-level imports for ui-patterns components to use specific components when importing.

* Remove the @ui-patterns shorthand since it works exactly the same without the @.

* More import fixes.

* Fix the ui-patterns tests.
2024-09-30 21:41:26 +02:00

31 lines
1022 B
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 value={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