diff --git a/components/canvas/nodes/ai-image-node.tsx b/components/canvas/nodes/ai-image-node.tsx index 6c5abf5..46ad8e3 100644 --- a/components/canvas/nodes/ai-image-node.tsx +++ b/components/canvas/nodes/ai-image-node.tsx @@ -7,6 +7,7 @@ import { api } from "@/convex/_generated/api"; import type { Id } from "@/convex/_generated/dataModel"; import BaseNodeWrapper from "./base-node-wrapper"; import { DEFAULT_MODEL_ID, getModel } from "@/lib/ai-models"; +import { cn, formatEurFromCents } from "@/lib/utils"; import { Loader2, AlertCircle, @@ -21,6 +22,8 @@ type AiImageNodeData = { model?: string; modelTier?: string; generatedAt?: number; + /** Gebuchte Credits in Euro-Cent (PRD: nach Commit) */ + creditCost?: number; canvasId?: string; _status?: string; _statusMessage?: string; @@ -116,7 +119,7 @@ export default function AiImageNode({ -
+
{status === "idle" && !nodeData.url && (
@@ -174,8 +177,25 @@ export default function AiImageNode({ /> )} + {nodeData.creditCost != null && + nodeData.url && + !isLoading && + status !== "error" && ( +
+ {formatEurFromCents(nodeData.creditCost)} +
+ )} + {status === "done" && nodeData.url && !isLoading && ( -
+