Files
jiang13-bbs/frontend/app/post/[id]/edit/EditPostClient.tsx
freefire 7a44c1f2cf feat: 可配置站点 URL 风格
- 新增 urlStyle 工具与测试:postPath/userPath/sitePagePath 统一生成链接
- 管理端新增 UrlStylePanel 设置面板,settings 服务与 handler 适配
- 全站路由链接与 JSON-LD/sitemap 切换为统一 URL 生成
- middleware 与相关组件适配
2026-09-27 04:01:42 +08:00

60 lines
1.4 KiB
TypeScript

"use client";
import PostComposer from "@/components/PostComposer";
import { useUrlStyle } from "@/components/SiteBrandProvider";
import { postPath } from "@/lib/urlStyle";
import type { PostAttachment } from "@/lib/api";
type Props = {
postId: number;
initialTitle: string;
initialContent: string;
initialTags: string;
initialPostType?: string;
initialTypeMeta?: string;
initialAttachments?: PostAttachment[];
canEditPollOptions?: boolean;
canEditLotteryPrizes?: boolean;
boardName: string;
boardId: number;
boardColorIndex?: number;
boardIcon?: string;
};
export default function EditPostClient({
postId,
initialTitle,
initialContent,
initialTags,
initialPostType,
initialTypeMeta,
initialAttachments,
canEditPollOptions,
canEditLotteryPrizes,
boardName,
boardId,
boardColorIndex = 0,
boardIcon,
}: Props) {
const urlStyle = useUrlStyle();
return (
<PostComposer
mode="edit"
postId={postId}
initialTitle={initialTitle}
initialContent={initialContent}
initialTags={initialTags}
initialPostType={initialPostType}
initialTypeMeta={initialTypeMeta}
initialAttachments={initialAttachments}
canEditPollOptions={canEditPollOptions}
canEditLotteryPrizes={canEditLotteryPrizes}
boardName={boardName}
boardId={boardId}
boardColorIndex={boardColorIndex}
boardIcon={boardIcon}
cancelHref={postPath(urlStyle, postId)}
/>
);
}