'use client' import type { FC } from 'react' import React from 'react' import cn from 'classnames' import { useTranslation } from 'react-i18next' import TypeIcon from '../type-icon' import RemoveIcon from '../../base/icons/remove-icon' import s from './style.module.css' import type { DataSet } from '@/models/datasets' import { formatNumber } from '@/utils/format' import Tooltip from '@/app/components/base/tooltip' export type ICardItemProps = { className?: string config: DataSet onRemove: (id: string) => void readonly?: boolean } const CardItem: FC = ({ className, config, onRemove, readonly, }) => { const { t } = useTranslation() return (
{config.name}
{!config.embedding_available && ( {t('dataset.unavailable')} )}
{formatNumber(config.word_count)} {t('appDebug.feature.dataSet.words')} ยท {formatNumber(config.document_count)} {t('appDebug.feature.dataSet.textBlocks')}
{!readonly && onRemove(config.id)} />}
) } export default React.memo(CardItem)