/** * 模型列表 - 移动端卡片视图 */ import React from 'react' import { Button } from '@/components/ui/button' import { Badge } from '@/components/ui/badge' import { Pencil, Trash2 } from 'lucide-react' import type { ModelInfo } from '../types' interface ModelCardListProps { /** 当前页显示的模型 (分页后的) */ paginatedModels: ModelInfo[] /** 所有模型列表 (未分页) */ allModels: ModelInfo[] /** 编辑模型回调 */ onEdit: (model: ModelInfo, index: number) => void /** 删除模型回调 */ onDelete: (index: number) => void /** 检查模型是否被使用 */ isModelUsed: (modelName: string) => boolean /** 搜索关键词 */ searchQuery: string } export const ModelCardList = React.memo(function ModelCardList({ paginatedModels, allModels, onEdit, onDelete, isModelUsed, searchQuery, }: ModelCardListProps) { if (paginatedModels.length === 0) { return (
{searchQuery ? '未找到匹配的模型' : '暂无模型配置'}
) } return (
{paginatedModels.map((model, displayIndex) => { const actualIndex = allModels.findIndex(m => m === model) const used = isModelUsed(model.name) return (

{model.name}

{used ? '已使用' : '未使用'} {model.visual && ( 视觉 )}

{model.model_identifier}

提供商

{model.api_provider}

模型温度

{model.temperature != null ? model.temperature : 默认}

输入价格

¥{model.price_in}/M

输出价格

¥{model.price_out}/M

) })}
) })