import { uploadToHuggingFace } from "@gradio/utils"; import type { FileData } from "@gradio/upload"; export async function format_gallery_for_sharing( value: [FileData, string | null][] | null ): Promise { if (!value) return ""; let urls = await Promise.all( value.map(async ([image, _]) => { if (image === null) return ""; return await uploadToHuggingFace(image.data, "url"); }) ); return `
${urls .map((url) => ``) .join("")}
`; }