import type { FmpBusiness } from "node_modules/@feedmepos/mf-common/dist/store"; import type { GetEmailAddressData } from "@/api/email"; export interface EmailDialogProps { show?: boolean; /** HTML content for the iframe preview. */ modelValue?: string; email?: string; business?: FmpBusiness; senderName?: string; senderEmail?: string; recipientName?: string; /** * Preview-only PDF blob URL (bulk view's dispatch mode) — shown in an * iframe purely so the user can see what will be sent. Has no bearing on * the actual send: the email attachment is generated independently, * server-side, by the enqueued Lambda job. Caller revokes via * URL.revokeObjectURL when done. */ pdfBlobUrl?: string; /** True while the preview PDF is being generated — shows a spinner instead of the iframe. */ pdfLoading?: boolean; /** * When set, the dialog runs in "dispatch" mode (bulk view's single-email * action): no direct SMS-API send. Send simply invokes this with the chosen * sender and optional body text — the caller enqueues the background * Lambda job (same pipeline as Email All) and owns its own success/error * messaging. Throw to keep the dialog open on failure. */ onDispatch?: (payload: { sender: GetEmailAddressData; message: string; }) => Promise | void; /** Called when the dialog requests a visibility change (e.g. user closes it). */ 'onUpdate:show'?: (show: boolean) => void; } export interface EmailDialogEvents { (e: 'update:show', value: boolean): void; }