const MAX_DOCUMENT_BYTES = 10 * 1024 * 1024; const ALLOWED_DOCUMENT_TYPES = new Set(["application/pdf", "image/jpeg", "image/png"]); export function validateVendorDocument(file: File): string | undefined { if (!ALLOWED_DOCUMENT_TYPES.has(file.type)) { return "Only PDF, JPG, and PNG files are allowed."; } if (file.size > MAX_DOCUMENT_BYTES) { return "Files must be 10 MB or smaller."; } }