import { Attributes, ComponentChildren, VNode, toChildArray } from "preact"; import { render } from "preact-render-to-string"; import { writeText } from "copy-paste"; export function Main({ children, ...attributes }: { children: ComponentChildren; attributes?: Attributes; }) { return (
{...toChildArray(children)}
); } export const HCenter = ({ children, ...attrs }: { children: ComponentChildren; attrs?: Attributes; }) => (
{...toChildArray(children)}
); export const eggbug_emotions = { smiling: ( eggbug, smiling ), } as const; export const EggbugImg = ({ type }: { type: keyof typeof eggbug_emotions }) => eggbug_emotions[type]; export const render_and_copy = (elem: VNode) => { const rendered = render(elem); writeText(rendered); console.log(rendered); };