'use client' import type { FC } from 'react' import React, { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { RiCloseLine } from '@remixicon/react' import CSVUploader from './csv-uploader' import CSVDownloader from './csv-downloader' import Button from '@/app/components/base/button' import Modal from '@/app/components/base/modal' import type { DocForm } from '@/models/datasets' export type IBatchModalProps = { isShow: boolean docForm: DocForm onCancel: () => void onConfirm: (file: File) => void } const BatchModal: FC = ({ isShow, docForm, onCancel, onConfirm, }) => { const { t } = useTranslation() const [currentCSV, setCurrentCSV] = useState() const handleFile = (file?: File) => setCurrentCSV(file) const handleSend = () => { if (!currentCSV) return onCancel() onConfirm(currentCSV) } useEffect(() => { if (!isShow) setCurrentCSV(undefined) }, [isShow]) return ( { }} className='px-8 py-6 !max-w-[520px] !rounded-xl'>
{t('datasetDocuments.list.batchModal.title')}
) } export default React.memo(BatchModal)