// The server refuses a document with no file in words a patient cannot act on, so the sheet says it first. export const DOCUMENT_NEEDS_FILE = 'Attach a file to save this document.'; export const missingDocumentFile = (data: { content?: Array<{ attachment?: unknown }> } | undefined): string | null => (data?.content ?? []).some((item) => item?.attachment) ? null : DOCUMENT_NEEDS_FILE;