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 EbookPage({ 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}`)
|
||||
@@ -89,6 +91,13 @@ export default function EbookPage({ params }: { params: Promise<{ slug: string }
|
||||
<Link href="/dashboard" className="rounded-full bg-[#ff4d4f] px-5 py-3 text-sm font-semibold text-white hover:bg-[#ff7a45]">
|
||||
用城市数据规划路线
|
||||
</Link>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setSubmissionOpen(true)}
|
||||
className="rounded-full border border-[#ff4d4f] px-5 py-3 text-sm font-semibold text-[#ff4d4f] hover:bg-[#ff4d4f]/10"
|
||||
>
|
||||
{locale === "zh" ? "投稿电子书" : "Submit ebook"}
|
||||
</button>
|
||||
<Link href="/" className="rounded-full border border-gray-300 px-5 py-3 text-sm font-semibold text-gray-700 hover:bg-gray-100 dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800">
|
||||
返回首页
|
||||
</Link>
|
||||
@@ -109,6 +118,12 @@ export default function EbookPage({ params }: { params: Promise<{ slug: string }
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
<ContentSubmissionModal
|
||||
open={submissionOpen}
|
||||
locale={locale}
|
||||
submissionType="ebook"
|
||||
onClose={() => setSubmissionOpen(false)}
|
||||
/>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user