"use client"; import { useEffect } from "react"; import { useWorkflowStore } from "@/store/workflowStore"; import { PredictedCostResult, formatCost, PRICING } from "@/utils/costCalculator"; interface CostDialogProps { predictedCost: PredictedCostResult; incurredCost: number; onClose: () => void; } export function CostDialog({ predictedCost, incurredCost, onClose }: CostDialogProps) { const resetIncurredCost = useWorkflowStore((state) => state.resetIncurredCost); useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { if (e.key === "Escape") { onClose(); } }; window.addEventListener("keydown", handleKeyDown); return () => window.removeEventListener("keydown", handleKeyDown); }, [onClose]); const handleReset = () => { if (confirm("Reset incurred cost to $0.00?")) { resetIncurredCost(); } }; return (
No generation nodes in workflow
)}Actual API spend from successful generations
{incurredCost > 0 && ( )}Pricing Reference:
Nano Banana (Flash): ${PRICING["nano-banana"]["1K"]}/image
Nano Banana Pro 1K/2K: ${PRICING["nano-banana-pro"]["1K"]}/image
Nano Banana Pro 4K: ${PRICING["nano-banana-pro"]["4K"]}/image
All prices in USD