import { Info } from 'lucide-react' import { Tooltip, TooltipContent, TooltipTrigger } from 'ui' import { SlotLagMetricKey, SlotLagMetrics } from './ReplicationPipelineStatus.types' import { getFormattedLagValue } from './ReplicationPipelineStatus.utils' const SLOT_LAG_FIELDS: { key: SlotLagMetricKey label: string type: 'bytes' | 'duration' description: string }[] = [ { key: 'confirmed_flush_lsn_bytes', label: 'WAL Flush lag (size)', type: 'bytes', description: 'Bytes between the newest WAL record applied locally and the latest flushed WAL record acknowledged by ETL.', }, { key: 'flush_lag', label: 'WAL Flush lag (time)', type: 'duration', description: 'Time between flushing recent WAL locally and receiving notification that ETL has written and flushed it.', }, { key: 'safe_wal_size_bytes', label: 'Remaining WAL size', type: 'bytes', description: 'Bytes still available to write to WAL before this slot risks entering the "lost" state.', }, ] export const SlotLagMetricsInline = ({ tableName, metrics, }: { tableName: string metrics: SlotLagMetrics }) => { return (