"use client"

import {
  LOCAL_UPLOAD_ONLY_ERROR,
  getPersistedImageUrlError,
  validateLocalImageFile,
} from "@/lib/media-manager/local-upload-policy"

/** Reject pasted/typed http(s) image URLs in controlled inputs. */
export function rejectExternalImageUrlInput(value: string): string | null {
  return getPersistedImageUrlError(value, { fieldPath: "image URL", mode: "persist" })
}

export function validateImageFileForUpload(file: File, maxBytes?: number): string | null {
  return validateLocalImageFile(file, maxBytes)
}

export { LOCAL_UPLOAD_ONLY_ERROR }
