import { DocumentsProps } from '../models/misc'; import Trash from '../assets/trash.svg'; import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; const Documents: React.FC = ({ documents, handleDeleteDocument, }) => { const { t } = useTranslation(); return (
{documents && documents.map((document, index) => ( ))}
{t('settings.documents.name')} {t('settings.documents.date')} {t('settings.documents.tokenUsage')} {t('settings.documents.type')}
{document.name} {document.date} {document.tokens ? document.tokens : ''} {document.location === 'remote' ? 'Pre-loaded' : 'Private'} {document.location !== 'remote' && ( Delete { event.stopPropagation(); handleDeleteDocument(index, document); }} /> )}
); }; Documents.propTypes = { documents: PropTypes.array.isRequired, handleDeleteDocument: PropTypes.func.isRequired, }; export default Documents;