"use client"; import { DOCUMENT_FILE_ACCEPT, MAX_DOCUMENT_FILES } from "@/utils/shared"; import DocumentItem from "./DocumentItem"; import useCompanyDocumentsPresenter from "./useCompanyDocumentsPresenter"; interface IProps { /** Present in edit mode; switches uploads to the company-documents endpoint. */ companyId?: string; value: string[]; onChange: (ids: string[]) => void; } const CompanyDocuments = ({ companyId, value, onChange }: IProps) => { const { isUploading, uploadProgress, failed, errorMessage, onSelectFiles, onRemove, } = useCompanyDocumentsPresenter({ companyId, value, onChange }); const inputId = "company-documents-input"; return (
Uploading documents… {companyId ? "" : `${uploadProgress}%`}
{errorMessage}
) : null} {value.length > 0 ? (No documents attached yet.
)} {failed.length > 0 ? (Failed uploads