- 新增 /explore 页面:浏览和搜索公开文件夹 - 新增 /explore/[id] 页面:以只读模式查看公开文件夹 - 新增 /favorites 页面:管理收藏的文件夹 - 重构 /folders 页面:仅显示当前用户的文件夹 - 更新导航栏:添加 Explore 和 Favorites 链接 - 添加 i18n 翻译:explore 和 favorites 相关文本 - 更新 AGENTS.md:添加数据库迁移规范(必须使用 migrate dev)
30 lines
662 B
TypeScript
30 lines
662 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { InFolder } from "@/app/folders/[folder_id]/InFolder";
|
|
import { actionGetFolderVisibility } from "@/modules/folder/folder-aciton";
|
|
|
|
export default async function ExploreFolderPage({
|
|
params,
|
|
}: {
|
|
params: Promise<{ id: string }>;
|
|
}) {
|
|
const { id } = await params;
|
|
|
|
if (!id) {
|
|
redirect("/explore");
|
|
}
|
|
|
|
const folderInfo = (await actionGetFolderVisibility(Number(id))).data;
|
|
|
|
if (!folderInfo) {
|
|
redirect("/explore");
|
|
}
|
|
|
|
const isPublic = folderInfo.visibility === "PUBLIC";
|
|
|
|
if (!isPublic) {
|
|
redirect("/explore");
|
|
}
|
|
|
|
return <InFolder folderId={Number(id)} isReadOnly={true} />;
|
|
}
|