mirror of
https://github.com/Since-3/since3-portal.git
synced 2026-10-12 19:51:17 +00:00
37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
import { accentColors } from "../lib/content"
|
|
import type { TemplateContent, TemplateDefinition } from "../lib/types"
|
|
import { AI_DEMO_SLUGS, AI_DEMOS, type AiDemoSlug } from "./demos"
|
|
import { businessName, collectImages } from "./knowledge"
|
|
|
|
export type DemoInfo = {
|
|
brand: string
|
|
industry: string
|
|
accent: string
|
|
accentFg: string
|
|
assistantName: string
|
|
greeting: string
|
|
images: string[]
|
|
samples: { inquiry: string; topic: string }
|
|
siteHref: string
|
|
demos: AiDemoSlug[]
|
|
}
|
|
|
|
// Serialisierbare Daten für die KI-Demo-Seiten; Admins sehen alle Demos, Kunden nur freigeschaltete
|
|
export function demoInfo(def: TemplateDefinition, content: TemplateContent, options: { siteHref: string; all: boolean }): DemoInfo {
|
|
const brand = businessName(def, content)
|
|
const name = content.ai.name.trim()
|
|
|
|
return {
|
|
brand,
|
|
industry: def.industry,
|
|
...accentColors(def, content),
|
|
assistantName: name || "KI-Assistent",
|
|
greeting:
|
|
content.ai.greeting.trim() ||
|
|
(name ? `Guten Tag, hier ist ${name} von ${brand}. Wie kann ich Ihnen helfen?` : `Guten Tag, Sie sprechen mit dem digitalen Assistenten von ${brand}. Wie kann ich Ihnen helfen?`),
|
|
images: collectImages(def, content),
|
|
samples: def.samples,
|
|
siteHref: options.siteHref,
|
|
demos: options.all ? AI_DEMO_SLUGS : AI_DEMO_SLUGS.filter((slug) => content.ai[AI_DEMOS[slug].feature]),
|
|
}
|
|
}
|