@@ -5,7 +5,6 @@ import { getIntegrationMetadata } from '@/lib/logs/get-trigger-options'
55import { getBlock } from '@/blocks/registry'
66import { CORE_TRIGGER_TYPES } from '@/stores/logs/filters/types'
77
8- /** Column configuration for logs table - shared between header and rows */
98export const LOG_COLUMNS = {
109 date : { width : 'w-[8%]' , minWidth : 'min-w-[70px]' , label : 'Date' } ,
1110 time : { width : 'w-[12%]' , minWidth : 'min-w-[90px]' , label : 'Time' } ,
@@ -16,10 +15,8 @@ export const LOG_COLUMNS = {
1615 duration : { width : 'w-[20%]' , minWidth : 'min-w-[100px]' , label : 'Duration' } ,
1716} as const
1817
19- /** Type-safe column key derived from LOG_COLUMNS */
2018export type LogColumnKey = keyof typeof LOG_COLUMNS
2119
22- /** Ordered list of column keys for rendering table headers */
2320export const LOG_COLUMN_ORDER : readonly LogColumnKey [ ] = [
2421 'date' ,
2522 'time' ,
@@ -30,7 +27,6 @@ export const LOG_COLUMN_ORDER: readonly LogColumnKey[] = [
3027 'duration' ,
3128] as const
3229
33- /** Possible execution status values for workflow logs */
3430export type LogStatus = 'error' | 'pending' | 'running' | 'info' | 'cancelled'
3531
3632/**
@@ -53,30 +49,28 @@ export function getDisplayStatus(status: string | null | undefined): LogStatus {
5349 }
5450}
5551
56- /** Configuration mapping log status to Badge variant and display label */
57- const STATUS_VARIANT_MAP : Record <
52+ export const STATUS_CONFIG : Record <
5853 LogStatus ,
59- { variant : React . ComponentProps < typeof Badge > [ 'variant' ] ; label : string }
54+ { variant : React . ComponentProps < typeof Badge > [ 'variant' ] ; label : string ; color : string }
6055> = {
61- error : { variant : 'red' , label : 'Error' } ,
62- pending : { variant : 'amber' , label : 'Pending' } ,
63- running : { variant : 'green' , label : 'Running' } ,
64- cancelled : { variant : 'gray ' , label : 'Cancelled' } ,
65- info : { variant : 'gray' , label : 'Info' } ,
56+ error : { variant : 'red' , label : 'Error' , color : 'var(--text-error)' } ,
57+ pending : { variant : 'amber' , label : 'Pending' , color : '#f59e0b' } ,
58+ running : { variant : 'green' , label : 'Running' , color : '#22c55e' } ,
59+ cancelled : { variant : 'orange ' , label : 'Cancelled' , color : '#f97316 ' } ,
60+ info : { variant : 'gray' , label : 'Info' , color : 'var(--terminal-status-info-color)' } ,
6661}
6762
68- /** Configuration mapping core trigger types to Badge color variants */
6963const TRIGGER_VARIANT_MAP : Record < string , React . ComponentProps < typeof Badge > [ 'variant' ] > = {
7064 manual : 'gray-secondary' ,
7165 api : 'blue' ,
7266 schedule : 'green' ,
7367 chat : 'purple' ,
7468 webhook : 'orange' ,
69+ mcp : 'cyan' ,
7570 a2a : 'teal' ,
7671}
7772
7873interface StatusBadgeProps {
79- /** The execution status to display */
8074 status : LogStatus
8175}
8276
@@ -86,14 +80,13 @@ interface StatusBadgeProps {
8680 * @returns A Badge with dot indicator and status label
8781 */
8882export const StatusBadge = React . memo ( ( { status } : StatusBadgeProps ) => {
89- const config = STATUS_VARIANT_MAP [ status ]
83+ const config = STATUS_CONFIG [ status ]
9084 return React . createElement ( Badge , { variant : config . variant , dot : true } , config . label )
9185} )
9286
9387StatusBadge . displayName = 'StatusBadge'
9488
9589interface TriggerBadgeProps {
96- /** The trigger type identifier (e.g., 'manual', 'api', or integration block type) */
9790 trigger : string
9891}
9992
0 commit comments