// 应用表单数据类型
export interface AppFormData {
    id?: string;
    name: string;
    desc: string;
    prompt: string;
    topP: number;
    topK: number;
    temperature: number;
    knowledge_ids: string[];
    model: string;
    iconColor: string;
    iconType: string;
    questionList: string[];
    max_token: number;
    typeId: string;
    visible: string;
    sort?: number;
    appProId?: string;
    groupVisible?: boolean;
    vipList?: VipUser[];
}

// VIP 用户数据
export interface VipUser {
    userId: string;
    userName: string;
}

// RAG 配置数据
export interface RAGConfig {
    param_desc: string;
    show_recall_result: boolean;
    recall_method: string;
    rerank_status: boolean;
    rerank_model_name: string;
    slice_config_type: string;
    slice_count: number;
    is_multi_round: string;
    multi_round: number;
    rerank_index_type_list: KnowledgeIndexItem[];
    recall_index_type_list: KnowledgeIndexItem[];
}

// 知识库索引项
export interface KnowledgeIndexItem {
    index_type_id: number;
    knowledge_id: string;
}

// 应用详情数据（API 返回）
export interface AppDetail {
    id: string;
    appId: string;
    name: string;
    desc: string;
    prompt: string;
    topP: number;
    topK: number;
    temperature: number;
    knowledgeIds: string[];
    model: string;
    iconColor: string;
    iconType: string;
    questionlist: Array<{ question: string }>;
    maxToken: number;
    updateDate: string;
    appProId?: string;
    typeId: string;
    visible: string;
    sort?: number;
    groupVisible: boolean;
    knowledgeInfo: string;  // JSON string of RAGConfig
    vipList?: VipUser[];
}

// 表单模式
export type FormMode = 'create' | 'edit';

// 组件 Props
export interface QuestionAnswerFormProps {
    mode: FormMode;
    appId?: string;  // 编辑模式下需要
}

// 步骤 1 组件 Props
export interface Step1BasicProps {
    form: any;
    appTypeList: any[];
    appVisibleList: any[];
    appProjectList: any[];
    isAppPro: boolean;
    visibleFlag: string | number;
    vipList: VipUser[];
    userInfo: any;
    inputs: InputItem[];
    selectedIcon: string | null;
    previewBg: string;
    onAppChange: (typeId: number) => void;
    onVisibleChange: (value: any) => void;
    onAddVip: () => void;
    onRemoveVip: (userId: string) => void;
    onNext: (values: any) => void;
    onBack: () => void;
    onIconChange: (icon: string) => void;
    onBgColorChange: (color: string) => void;
    onInputsChange: (inputs: InputItem[]) => void;
}

// 步骤 2 组件 Props
export interface Step2ConfigProps {
    form: any;
    knowledgeList: any[];
    modelList: any[];
    rerankModelList: any[];
    topPValue: number;
    tempValue: number;
    isVisible: boolean;
    isVisibleCus: boolean;
    isVisibleSlice: boolean;
    isDeepThinkVisible: boolean;
    isMultiRound: boolean;
    automatic: boolean;
    name: string;
    onTopPChange: (value: number) => void;
    onTempChange: (value: number) => void;
    onModelChange: (value: string) => void;
    onRecallMethodChange: (e: RadioChangeEvent) => void;
    onSliceCountChange: (value: string) => void;
    onMultiRoundChange: (checked: boolean) => void;
    onAutomaticChange: (checked: boolean) => void;
    onBack: () => void;
    onSubmit: (values: any) => void;
    onSave?: (values: any) => void;
    createFlag: boolean;
    appId?: string;
}

// 输入项
export interface InputItem {
    id: number;
    value: string;
}
