'use client' import type { FC } from 'react' import React from 'react' import { useCSVDownloader, } from 'react-papaparse' import { useTranslation } from 'react-i18next' import { Download02 as DownloadIcon } from '@/app/components/base/icons/src/vender/solid/general' export type ICSVDownloadProps = { vars: { name: string }[] } const CSVDownload: FC = ({ vars, }) => { const { t } = useTranslation() const { CSVDownloader, Type } = useCSVDownloader() const addQueryContentVars = [...vars] const template = (() => { const res: Record = {} addQueryContentVars.forEach((item) => { res[item.name] = '' }) return res })() return (
{t('share.generation.csvStructureTitle')}
{addQueryContentVars.map((item, i) => ( ))} {addQueryContentVars.map((item, i) => ( ))}
{item.name}
{item.name} {t('share.generation.field')}
{t('share.generation.downloadTemplate')}
) } export default React.memo(CSVDownload)