import { Form, InputNumber, Switch, type FormInstance } from "antd"; import type { ChannelModelFormValues } from "./channel-model-editor-form"; export function CreditCostFields({ index, form, billingMode, isVideo }: { index: number; form: FormInstance; billingMode: string; isVideo: boolean }) { const configured = Form.useWatch(["priceTiers", index, "costConfigured"], form) === true; const fields = billingMode === "token" ? isVideo ? [["costOutputTokenPrice", "积分 / 百万视频 Token"]] : [ ["costInputTokenPrice", "输入 / 百万 Token"], ["costOutputTokenPrice", "输出 / 百万 Token"], ["costCachedTokenPrice", "缓存 / 百万 Token"], ] : [["costUnitPrice", billingMode === "per_second" ? "积分 / 秒" : "积分 / 次"]]; return (
积分成本 仅管理员可见

按当前计费方式填写成本,不影响用户售价。

{configured ? (
{fields.map(([field, label]) => ( ))}
) : null}
); }