"use client"; import Link from "next/link"; import { useState } from "react"; import { ArrowUpRight, BookOpen, Film, MessageCircle, Play, } from "lucide-react"; import SiteShell from "./SiteShell"; import { BookmarkButton, DemoBadge, EmptyState, PageIntro, SearchField, ShareButton, SocialDialog, } from "./SocialUI"; import { useSocialConfig } from "./SocialExperience"; import { SEED_EBOOKS, SEED_VIDEOS } from "@social/lib/seed"; import { useLocalState } from "@social/lib/useLocalState"; import { socialPath } from "@social/lib/socialPath"; type Kind = "videos" | "date" | "ebook"; const COPY = { videos: { title: "共创 · 视频", accent: "大家拍的" }, date: { title: "共创 · 访谈", accent: "听听大家" }, ebook: { title: "共创 · 小册", accent: "大家写的" }, }; function safeSource(value?: string) { if (!value) return undefined; try { const url = new URL(value, "https://nomadro.cn"); return url.protocol === "https:" || url.protocol === "http:" ? value : undefined; } catch { return undefined; } } function ResourcePlayer({ source }: { source: string }) { const [failed, setFailed] = useState(false); return ( <>