import { createTextVNode, computed, defineComponent, h, inject, onServerPrefetch, ref, type VNode, watchEffect } from "vue"; import { RouterLink } from "vue-router"; import useAsyncState from "@/useAsyncState.ts"; import useHead from "@/useHead.ts"; import DJEmail from "@/DJEmail.tsx"; import getDJAPI from "@/api.ts"; export default defineComponent({ name: "ge-deutsch-article", props: { articleName: { type: String, required: true, }, }, async setup(props) { const currentLang = ref<"en" | "de">("de"); function clickBtn() { currentLang.value = currentLang.value === "en" ? "de" : "en"; } const parseDom = inject( "dom-parse", (innerHTML: string) => Object.assign(document.createElement("div"), { innerHTML }), ); const { result: articleContent, stateIsReady } = useAsyncState( "ge-deutsch-article-data", async ({ hostUrl }) => { const articleResponse = await fetch(`${hostUrl}/generative-energy/content/${props.articleName}.html`); const result = await articleResponse.text(); return result; }, ); const { result: articleData, stateIsReady: articleDataReady, } = useAsyncState('article-data', ({hostUrl}) => getDJAPI(hostUrl, '/rp-articles')); const articleMetadata = computed(() => articleData.value?.find(_ => _.slug === props.articleName)); const title = computed(() => { return articleContent.value?.split('
Bei dem untenstehenden Artikel handelt es sich um eine hobbymäßige, amateurhafte Übersetzung des
Artikels „{ title.value }“ von Ray Peat. Bei Ungenauigkeiten oder Fehlübersetzungen freue ich mich über