// Share a media File (image/video) via the OS share sheet. Wraps `_creatorUtils.shareMedia`, which
// takes the host buffer id behind the File. On iOS the sheet also lets the user save to Files/Photos;
// on web it saves (downloads) the file. `text` is an optional caption/message.

import type { File, FetchResponse } from "./fetch"

export function share(media: File | FetchResponse, text?: string): void {
  _creatorUtils.shareMedia((media as any).id ?? (media as any)._id, text)
}
