refactor: remove credit cost calculations and related UI elements from canvas node panels

This commit is contained in:
HouYunFei
2026-07-05 13:44:42 +08:00
parent 522153b3e6
commit 9dd0dc28b2
3 changed files with 1 additions and 41 deletions
-25
View File
@@ -1,25 +0,0 @@
import type { ComponentProps } from "react";
import { Zap } from "lucide-react";
export function CreditSymbol({ className, ...props }: ComponentProps<"span">) {
return (
<span {...props} className={`inline-flex items-center justify-center ${className || ""}`}>
<Zap className="size-[1em] fill-current" strokeWidth={2.4} />
</span>
);
}
export type ModelCreditCost = {
model: string;
credits: number;
};
function modelCreditCost(modelCosts: ModelCreditCost[] | undefined, model: string) {
return modelCosts?.find((item) => item.model === model)?.credits || 0;
}
export function requestCreditCost(options: { channelMode: string; modelCosts?: ModelCreditCost[]; model: string; count?: string | number }) {
if (options.channelMode !== "remote") return 0;
const count = Math.max(1, Math.floor(Math.abs(Number(options.count)) || 1));
return modelCreditCost(options.modelCosts, options.model) * count;
}