From 70004b0d0f638291fb964d7ec4d0b6b7e02be25d Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Tue, 17 Mar 2026 20:10:23 +0800 Subject: [PATCH] Extract hero video media config --- src/app/page.tsx | 49 +++------------------------------- src/lib/home/heroVideoMedia.ts | 44 ++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 45 deletions(-) create mode 100644 src/lib/home/heroVideoMedia.ts diff --git a/src/app/page.tsx b/src/app/page.tsx index 2ef19ad..b8a503c 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -24,6 +24,10 @@ import Footer from "../components/Footer"; import UnifiedNavigation from "../components/UnifiedNavigation"; import { useLanguage } from "../i18n/LanguageProvider"; import { translations } from "../i18n/translations"; +import { + heroVideoMedia, + type HeroVideoMedia, +} from "../lib/home/heroVideoMedia"; import { useMoltbotStore } from "../lib/moltbotStore"; import { useUserStore } from "../lib/userStore"; import { cn } from "../lib/utils"; @@ -67,51 +71,6 @@ const iconMap: Record = { const getIcon = (key: string, fallback: any) => iconMap[key] || fallback; -type HeroVideoMedia = { - posterUrl?: string; - videoUrl?: string; - title: { - zh: string; - en: string; - }; - description: { - zh: string; - en: string; - }; - statusLabel: { - zh: string; - en: string; - }; - durationLabel: string; - chapters: { - zh: string; - en: string; - }[]; -}; - -const heroVideoMedia: HeroVideoMedia = { - posterUrl: "", - videoUrl: "", - title: { - zh: "用一段视频解释从灵感到上线的完整路径", - en: "Show the full path from idea to launch in one video", - }, - description: { - zh: "建议后续放 60 到 120 秒的产品导览、集成配置流程,或真实部署 walkthrough。", - en: "Best used for a 60-120 second product tour, integration setup flow, or real deployment walkthrough.", - }, - statusLabel: { - zh: "视频待接入", - en: "Video pending", - }, - durationLabel: "00:00 / 02:18", - chapters: [ - { zh: "开场介绍", en: "Intro" }, - { zh: "集成配置", en: "Setup" }, - { zh: "上线演示", en: "Launch" }, - ], -}; - export default function HomePage() { const { mode, isOpen } = useMoltbotStore(); diff --git a/src/lib/home/heroVideoMedia.ts b/src/lib/home/heroVideoMedia.ts new file mode 100644 index 0000000..1f34c30 --- /dev/null +++ b/src/lib/home/heroVideoMedia.ts @@ -0,0 +1,44 @@ +export type HeroVideoMedia = { + posterUrl?: string; + videoUrl?: string; + title: { + zh: string; + en: string; + }; + description: { + zh: string; + en: string; + }; + statusLabel: { + zh: string; + en: string; + }; + durationLabel: string; + chapters: { + zh: string; + en: string; + }[]; +}; + +export const heroVideoMedia: HeroVideoMedia = { + posterUrl: "", + videoUrl: "", + title: { + zh: "用一段视频解释从灵感到上线的完整路径", + en: "Show the full path from idea to launch in one video", + }, + description: { + zh: "建议后续放 60 到 120 秒的产品导览、集成配置流程,或真实部署 walkthrough。", + en: "Best used for a 60-120 second product tour, integration setup flow, or real deployment walkthrough.", + }, + statusLabel: { + zh: "视频待接入", + en: "Video pending", + }, + durationLabel: "00:00 / 02:18", + chapters: [ + { zh: "开场介绍", en: "Intro" }, + { zh: "集成配置", en: "Setup" }, + { zh: "上线演示", en: "Launch" }, + ], +};