UNPKG

rsshub

Version:
105 lines (103 loc) 2.26 kB
import { jsx, jsxs } from "hono/jsx/jsx-runtime"; import { renderToString } from "hono/jsx/dom/server"; //#region lib/routes/qweather/util.tsx const render3DaysDescription = (item) => renderToString(/* @__PURE__ */ jsx(WeatherForecast, { item })); const renderNowDescription = (item) => renderToString(/* @__PURE__ */ jsx(Now, { item })); const WeatherForecast = ({ item }) => /* @__PURE__ */ jsxs("p", { children: [ "白天:", item.textDay, "——夜间:", item.textNight, /* @__PURE__ */ jsx("br", {}), "气温:", item.tempMin, "℃~", item.tempMax, "℃", /* @__PURE__ */ jsx("br", {}), "相对湿度:", item.humidity, "%", /* @__PURE__ */ jsx("br", {}), "空气质量指数:", item.aqi, " (", item.aqiCategory, ")", /* @__PURE__ */ jsx("br", {}), "大气压强:", item.pressure, "百帕", /* @__PURE__ */ jsx("br", {}), "紫外线强度:", item.uvIndex, /* @__PURE__ */ jsx("br", {}), "白天风向:", item.windDirDay, " 风力:", item.windScaleDay, "级 风速:", item.windSpeedDay, "公里/小时", /* @__PURE__ */ jsx("br", {}), "夜间风向:", item.windDirNight, " 风力:", item.windScaleNight, "级 风速:", item.windSpeedNight, "公里/小时", /* @__PURE__ */ jsx("br", {}), "能见度:", item.vis, "公里", /* @__PURE__ */ jsx("br", {}), "日出:", item.sunrise, " 日落: ", item.sunset, /* @__PURE__ */ jsx("br", {}), "月相:", item.moonPhase, " 月出:", item.sunrise, " 月落:", item.moonset ] }); const Now = ({ item }) => /* @__PURE__ */ jsxs("p", { children: [ "天气:", item.text, /* @__PURE__ */ jsx("br", {}), "气温:", item.temp, "℃", /* @__PURE__ */ jsx("br", {}), "体感温度:", item.feelsLike, "℃", /* @__PURE__ */ jsx("br", {}), "风向:", item.windDir, /* @__PURE__ */ jsx("br", {}), "风力:", item.windScale, "级 风速:", item.windSpeed, "km/h", /* @__PURE__ */ jsx("br", {}), "湿度:", item.humidity, "% 大气压强:", item.pressure, "hPa", /* @__PURE__ */ jsx("br", {}), "本小时降水量:", item.precip, "mm", /* @__PURE__ */ jsx("br", {}), "能见度:", item.vis, "km" ] }); //#endregion export { renderNowDescription as n, render3DaysDescription as t };