export function svgEmoji(req: Request) {
const url = new URL(req.url);
const emoji = decodeURIComponent(url.pathname.slice(1));
const cleanEmoji = emoji.replace(/&/g, "&").replace(/</g, "<");
return new Response(
`<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 16 16'><text x='0' y='14'>${cleanEmoji}</text></svg>`,
{
headers: {
"Content-Type": "image/svg+xml",
"Cache-Control": `public, max-age=${60 * 60 * 24}, s-maxage=${60 * 60 * 24}`,
},
},
);
}