'use client' import Pagination, { type Props as PaginationProps } from '@/app/components/base/pagination' import type { FC } from 'react' import { useState } from 'react' import Button from '@/app/components/base/button' import cn from '@/utils/classnames' import { delCorpus } from '@/service/common' import Confirm from '@/app/components/base/confirm' import DetailModal from './detail-modal' type PageListProps = { list: [] pagination: PaginationProps onUpdate: () => void } const IntentPageList: FC = ({ list = [], pagination, onUpdate, }) => { const [showConfirmDelete, setShowConfirmDelete] = useState(false) const [row, setRow] = useState({}) const handleDel = async () => { try { await delCorpus({ url: `/tags/${row.id}`, body: {}, }) setShowConfirmDelete(false) onUpdate() } catch (e) { } } const [detailModalVisible, setDetailModalVisible] = useState(false) const [transfer, setTransfer] = useState({ mode: 'add', row: {}, }) return ( <>
{list.map((item: any, index) => ( ))}
意图类型 意图名称 语料数量 关键词数量 创建时间 操作
1 2 3 4 2025-02-02 22:44:33
{/* Show Pagination only if the total is more than the limit */} {pagination.total && ( )}
{showConfirmDelete && ( setShowConfirmDelete(false)} /> )} { detailModalVisible && ( setDetailModalVisible(false)} onSend={() => { setDetailModalVisible(false) onUpdate() }} /> ) } ) } export default IntentPageList