mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-04 10:34:55 -05:00
- `curly` requires conditionals to use curly braces - `react/jsx-curly-brace-presence` requires string props to *not* have curly braces
24 lines
458 B
TypeScript
24 lines
458 B
TypeScript
type Base64AndCaption = {
|
|
base64: string;
|
|
caption: string;
|
|
};
|
|
|
|
const openBase64ImageInTab = (images: Base64AndCaption[]) => {
|
|
const w = window.open('');
|
|
if (!w) {
|
|
return;
|
|
}
|
|
|
|
images.forEach((i) => {
|
|
const image = new Image();
|
|
image.src = i.base64;
|
|
|
|
w.document.write(i.caption);
|
|
w.document.write('</br>');
|
|
w.document.write(image.outerHTML);
|
|
w.document.write('</br></br>');
|
|
});
|
|
};
|
|
|
|
export default openBase64ImageInTab;
|