import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { api } from "@community/lib/api"; import SiteShell from "@community/components/SiteShell"; import ToolRunnerClient from "@community/components/ToolRunnerClient"; import { TOOL_LINKS } from "@community/lib/tools"; import { isRunnableTool } from "@community/lib/toolsRegistry"; export const revalidate = 60; export function generateStaticParams() { return TOOL_LINKS.filter((t) => isRunnableTool(t.id)).map((t) => ({ id: t.id })); } export async function generateMetadata({ params, }: { params: Promise<{ id: string }>; }): Promise { const { id } = await params; const tool = TOOL_LINKS.find((t) => t.id === id); if (!tool) return { title: "工具 · nomadro" }; return { title: `${tool.title} · nomadro 工具箱`, description: tool.desc, }; } export default async function ToolPage({ params, }: { params: Promise<{ id: string }>; }) { const { id } = await params; if (!isRunnableTool(id)) notFound(); const destinations = await api.getDestinations().catch(() => []); return ( ); }