import React, { useState } from 'react'; import { Box, Card, Flex, FormControl, Input, Textarea, Slider, SliderTrack, SliderFilledTrack, SliderThumb, SliderMark, Tooltip, Button } from '@chakra-ui/react'; import { QuestionOutlineIcon } from '@chakra-ui/icons'; import type { ModelSchema } from '@/types/mongoSchema'; import { UseFormReturn } from 'react-hook-form'; import { modelList } from '@/constants/model'; import { formatPrice } from '@/utils/user'; import { useConfirm } from '@/hooks/useConfirm'; const ModelEditForm = ({ formHooks, canTrain, handleDelModel }: { formHooks: UseFormReturn; canTrain: boolean; handleDelModel: () => void; }) => { const { openConfirm, ConfirmChild } = useConfirm({ content: '确认删除该模型?' }); const { register, setValue, getValues } = formHooks; const [refresh, setRefresh] = useState(false); return ( <> 基本信息 名称: 底层模型: {getValues('service.modelName')} 价格: {formatPrice( modelList.find((item) => item.model === getValues('service.modelName'))?.price || 0, 1000 )} 元/1K tokens(包括上下文和回答) 删除: {/* 介绍: