'use client' import type { FC } from 'react' import React from 'react' import { PlayIcon, } from '@heroicons/react/24/solid' import { useTranslation } from 'react-i18next' import { RiLoader2Line, } from '@remixicon/react' import CSVReader from './csv-reader' import CSVDownload from './csv-download' import cn from '@/utils/classnames' import Button from '@/app/components/base/button' export type IRunBatchProps = { vars: { name: string }[] onSend: (data: string[][]) => void isAllFinished: boolean } const RunBatch: FC = ({ vars, onSend, isAllFinished, }) => { const { t } = useTranslation() const [csvData, setCsvData] = React.useState([]) const [isParsed, setIsParsed] = React.useState(false) const handleParsed = (data: string[][]) => { setCsvData(data) // console.log(data) setIsParsed(true) } const handleSend = () => { onSend(csvData) } const Icon = isAllFinished ? PlayIcon : RiLoader2Line return (
) } export default React.memo(RunBatch)