- 修复 folder-aciton.ts 文件名拼写错误为 folder-action.ts - 修复所有导入路径中的拼写错误 - 添加 repoGetPublicFolderById 和 actionGetPublicFolderById - 创建 ExploreDetailClient 详情页组件 - /explore/[id] 现在显示文件夹详情和链接到 /folders/[id] - 添加 exploreDetail 中英文翻译
24 lines
555 B
TypeScript
24 lines
555 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { ExploreDetailClient } from "./ExploreDetailClient";
|
|
import { actionGetPublicFolderById } from "@/modules/folder/folder-action";
|
|
|
|
export default async function ExploreFolderPage({
|
|
params,
|
|
}: {
|
|
params: Promise<{ id: string }>;
|
|
}) {
|
|
const { id } = await params;
|
|
|
|
if (!id) {
|
|
redirect("/explore");
|
|
}
|
|
|
|
const result = await actionGetPublicFolderById(Number(id));
|
|
|
|
if (!result.success || !result.data) {
|
|
redirect("/explore");
|
|
}
|
|
|
|
return <ExploreDetailClient folder={result.data} />;
|
|
}
|