--- import { getCVById, getProfileById } from "../../lib/db"; import { getLang, useT } from "../../lib/i18n"; import { TEMPLATES } from "../../types"; import Template1 from "../../components/templates/Template1.astro"; import Template2 from "../../components/templates/Template2.astro"; import Template3 from "../../components/templates/Template3.astro"; import Template4 from "../../components/templates/Template4.astro"; const { id } = Astro.params; const user = Astro.locals.user; const lang = getLang(Astro.request); const t = useT(lang); const cv = getCVById(id!, user.id); if (!cv) return Astro.redirect("/dashboard"); const profile = getProfileById(cv.profile_id, user.id); if (!profile) return Astro.redirect("/dashboard"); const d = profile.data; const s = cv.settings; const de = lang === "de"; function j(v: any) { return JSON.stringify(v).replace(/