ss
This commit is contained in:
@@ -4,6 +4,7 @@ import { use, useEffect, useState } from "react";
|
||||
import { Link, useLocale } from "@/i18n/navigation";
|
||||
import { apiFetch } from "@/app/lib/api-client";
|
||||
import Footer from "@/app/components/Footer";
|
||||
import ContentSubmissionModal from "@/app/components/ContentSubmissionModal";
|
||||
|
||||
interface ContentItem {
|
||||
slug: string;
|
||||
@@ -33,6 +34,7 @@ export default function VideoPage({ params }: { params: Promise<{ slug: string }
|
||||
const locale = useLocale();
|
||||
const [item, setItem] = useState<ContentItem | null>(null);
|
||||
const [cities, setCities] = useState<CityLite[]>([]);
|
||||
const [submissionOpen, setSubmissionOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
apiFetch<{ item: ContentItem; cities: CityLite[] }>(`/api/content/${slug}`)
|
||||
@@ -54,7 +56,16 @@ export default function VideoPage({ params }: { params: Promise<{ slug: string }
|
||||
return (
|
||||
<div className="min-h-screen bg-[#0f172a] text-white">
|
||||
<main className="mx-auto max-w-6xl px-4 py-8 sm:px-6 sm:py-12">
|
||||
<Link href="/" className="text-sm text-white/60 hover:text-white">← 返回首页</Link>
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<Link href="/" className="text-sm text-white/60 hover:text-white">← 返回首页</Link>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setSubmissionOpen(true)}
|
||||
className="rounded-full border border-[#ff7a45] px-4 py-2 text-sm font-semibold text-[#ffb088] hover:bg-[#ff7a45]/10"
|
||||
>
|
||||
{locale === "zh" ? "投稿访谈视频" : "Submit interview video"}
|
||||
</button>
|
||||
</div>
|
||||
<div className="mt-6 overflow-hidden rounded-2xl bg-black shadow-2xl">
|
||||
{item.mediaUrl ? (
|
||||
<video src={item.mediaUrl} poster={item.coverImage} controls playsInline className="aspect-video w-full bg-black object-contain" />
|
||||
@@ -94,6 +105,12 @@ export default function VideoPage({ params }: { params: Promise<{ slug: string }
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
<ContentSubmissionModal
|
||||
open={submissionOpen}
|
||||
locale={locale}
|
||||
submissionType="video"
|
||||
onClose={() => setSubmissionOpen(false)}
|
||||
/>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user