// ---------------------------------------------------------------------------
// Media API client  (client-side)
// ---------------------------------------------------------------------------
// Authenticated media serving endpoints. These return the actual file
// content (images, documents), not JSON. The Go API verifies residence
// access before serving.
// ---------------------------------------------------------------------------

/**
 * Build a proxied media URL that the browser can use in <img> src, etc.
 * The request goes through the Next.js proxy which attaches the auth cookie.
 *
 * NOTE: These URLs are only usable in an authenticated browser session.
 * For public sharing, a different approach would be needed.
 */

/** URL for an authenticated document file. */
export function documentUrl(documentId: number): string {
  return `/api/proxy/media/document/${documentId}`;
}

/** URL for an authenticated document image. */
export function documentImageUrl(imageId: number): string {
  return `/api/proxy/media/document-image/${imageId}`;
}

/** URL for an authenticated task completion image. */
export function completionImageUrl(imageId: number): string {
  return `/api/proxy/media/completion-image/${imageId}`;
}
