UNPKG

rsshub

Version:
28 lines (27 loc) 1.1 kB
import { Fragment, jsx, jsxs } from "hono/jsx/jsx-runtime"; import { renderToString } from "hono/jsx/dom/server"; import { raw } from "hono/html"; //#region lib/routes/yicai/templates/description.tsx const renderDescription = ({ image, intro, video, description }) => renderToString(/* @__PURE__ */ jsxs(Fragment, { children: [ !video?.src && image?.src ? /* @__PURE__ */ jsx("figure", { children: /* @__PURE__ */ jsx("img", { src: image.src, alt: image.alt ?? void 0, width: image.width ?? void 0, height: image.height ?? void 0 }) }) : null, intro ? /* @__PURE__ */ jsx("p", { children: intro }) : null, video?.src ? /* @__PURE__ */ jsxs("video", { poster: video.poster ?? image?.src ?? void 0, controls: true, children: [/* @__PURE__ */ jsx("source", { src: video.src, type: video.type ?? void 0 }), /* @__PURE__ */ jsx("object", { data: video.src, children: /* @__PURE__ */ jsx("embed", { src: video.src }) })] }) : null, description ? /* @__PURE__ */ jsx(Fragment, { children: raw(description) }) : null ] })); //#endregion export { renderDescription as t };