- {latestStats.priceUsd !== undefined && (
-
- Price:
- {formatPrice(latestStats.priceUsd)}
-
- )}
- {latestStats.processingTime !== undefined && (
-
- Time:
- {formatProcessingTime(latestStats.processingTime)}
-
- )}
- {latestStats.bytesSent !== undefined && (
-
- Sent:
- {formatBytes(latestStats.bytesSent)}
-
- )}
- {latestStats.bytesReceived !== undefined && (
-
- Received:
- {formatBytes(latestStats.bytesReceived)}
-
- )}
+
+ Cost:
+ {_formatCurrency(latestStats.priceCHF)}
+
)}
diff --git a/src/components/UiComponents/WorkflowStatus/WorkflowStatusTypes.ts b/src/components/UiComponents/WorkflowStatus/WorkflowStatusTypes.ts
index d83ca14..5275b9a 100644
--- a/src/components/UiComponents/WorkflowStatus/WorkflowStatusTypes.ts
+++ b/src/components/UiComponents/WorkflowStatus/WorkflowStatusTypes.ts
@@ -44,13 +44,10 @@ export interface WorkflowStatusProps {
isRunning?: boolean;
/**
- * Latest statistics from the workflow (price, processing time, bytes sent/received)
+ * Latest cost from billing transactions (single source of truth)
*/
latestStats?: {
- priceUsd?: number;
- processingTime?: number;
- bytesSent?: number;
- bytesReceived?: number;
+ priceCHF?: number;
} | null;
}
diff --git a/src/hooks/playground/useWorkflowLifecycle.ts b/src/hooks/playground/useWorkflowLifecycle.ts
index 9b1be84..085d6f7 100644
--- a/src/hooks/playground/useWorkflowLifecycle.ts
+++ b/src/hooks/playground/useWorkflowLifecycle.ts
@@ -14,8 +14,8 @@ import { useWorkflowPolling } from './useWorkflowPolling';
import { getWorkflowApiBaseUrl } from '../useWorkflows';
interface UnifiedChatDataItem {
- type: 'message' | 'log' | 'stat';
- item: WorkflowMessage | WorkflowLog | any;
+ type: 'message' | 'log';
+ item: WorkflowMessage | WorkflowLog;
createdAt: number;
}
@@ -76,13 +76,11 @@ export function useWorkflowLifecycle(instanceId: string) {
const [logs, setLogs] = useState