"use client"; import type { Dispatch, SetStateAction } from "react"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { cn } from "@/lib/utils"; import type { InboundOption, NodeOption, PlanFormValue, PlanPricingMode, } from "./plan-form-types"; type FieldId = (name: string) => string; export function ProxyNodeFields({ fieldId, nodes, nodeId, setNodeId, inbounds, setInbounds, selectedInboundIds, setSelectedInboundIds, toggleInbound, }: { fieldId: FieldId; nodes: NodeOption[]; nodeId: string; setNodeId: Dispatch>; inbounds: InboundOption[]; setInbounds: Dispatch>; selectedInboundIds: string[]; setSelectedInboundIds: Dispatch>; toggleInbound: (inboundId: string) => void; }) { return ( <>
{inbounds.map((inbound) => { const selected = selectedInboundIds.includes(inbound.id); return ( ); })}
{nodeId && inbounds.length === 0 && (

该节点暂无可用入站

)}
); } export function ProxyPricingFields({ fieldId, plan, pricingMode, setPricingMode, }: { fieldId: FieldId; plan?: PlanFormValue; pricingMode: PlanPricingMode; setPricingMode: Dispatch>; }) { const pricingModeLabels: Record = { TRAFFIC_SLIDER: "用户自选流量", FIXED_PACKAGE: "固定流量套餐", }; return ( <>
{pricingMode === "TRAFFIC_SLIDER" ? (
) : (
)}
); } /** @deprecated Use ProxyNodeFields + ProxyPricingFields instead */ export function ProxyConfigSection(props: { fieldId: FieldId; plan?: PlanFormValue; nodes: NodeOption[]; nodeId: string; setNodeId: Dispatch>; inbounds: InboundOption[]; setInbounds: Dispatch>; selectedInboundIds: string[]; setSelectedInboundIds: Dispatch>; toggleInbound: (inboundId: string) => void; pricingMode: PlanPricingMode; setPricingMode: Dispatch>; }) { return ( <> ); }