- 修复 folder-aciton.ts 文件名拼写错误为 folder-action.ts - 修复所有导入路径中的拼写错误 - 添加 repoGetPublicFolderById 和 actionGetPublicFolderById - 创建 ExploreDetailClient 详情页组件 - /explore/[id] 现在显示文件夹详情和链接到 /folders/[id] - 添加 exploreDetail 中英文翻译
21 lines
667 B
TypeScript
21 lines
667 B
TypeScript
import { DictionaryClient } from "./DictionaryClient";
|
|
import { auth } from "@/auth";
|
|
import { headers } from "next/headers";
|
|
import { actionGetFoldersByUserId } from "@/modules/folder/folder-action";
|
|
import { TSharedFolder } from "@/shared/folder-type";
|
|
|
|
export default async function DictionaryPage() {
|
|
const session = await auth.api.getSession({ headers: await headers() });
|
|
|
|
let folders: TSharedFolder[] = [];
|
|
|
|
if (session?.user?.id) {
|
|
const result = await actionGetFoldersByUserId(session.user.id as string);
|
|
if (result.success && result.data) {
|
|
folders = result.data;
|
|
}
|
|
}
|
|
|
|
return <DictionaryClient initialFolders={folders} />;
|
|
}
|