final start

This commit is contained in:
Shivam Meena
2023-11-24 13:38:57 +05:30
parent b2c5bc1633
commit 043876f356
3 changed files with 54 additions and 23 deletions

View File

@@ -1,9 +1,16 @@
import satori, { init } from 'satori/wasm';
import initYoga from 'yoga-wasm-web';
import { Resvg, initWasm } from '@resvg/resvg-wasm';
import { loadGoogleFont } from './font.js';
import type { ImageResponseOptions } from './types.js';
import {toReactElement, svelteComponentToJsx} from "@ethercorps/svelte-h2j"
import { html } from "satori-html";
import {ImageResponse as IR} from "@vercel/og"
import type {SvelteComponent} from "svelte";
export const ImageResponse = async (htmlTemplate: string, options?: ImageResponseOptions) => {
const reactVNode = html(`${htmlTemplate}`);
const reactVNode = toReactElement(`${htmlTemplate}`);
console.log(reactVNode)
return new IR(reactVNode, options)
};