diff --git a/apps/web/app/components/library/episode-structure.test.ts b/apps/web/app/components/library/episode-structure.test.ts index ff814ad3..268cd437 100644 --- a/apps/web/app/components/library/episode-structure.test.ts +++ b/apps/web/app/components/library/episode-structure.test.ts @@ -10,7 +10,13 @@ import { StructureTrack, SubscriptionSeasonPicker, } from "./episode-structure.tsx"; -import { hasStructureChoice, inLibraryText, originText, seasonLine, structureOptions } from "./episode-structure-model.ts"; +import { + hasStructureChoice, + inLibraryText, + originText, + seasonLine, + structureOptions, +} from "./episode-structure-model.ts"; const ENTITY = "6b1f2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d"; @@ -159,7 +165,7 @@ describe("季集结构:组件", () => { withCache(createElement(SubscriptionSeasonPicker, { entityId: ENTITY, value: "", onChange: () => {} }), empty), ).toBe(""); const html = withCache( - createElement(EpisodeStructureSwitcher, { entityId: ENTITY, children: createElement("p", null, "原季列表") }), + createElement(EpisodeStructureSwitcher, { entityId: ENTITY }, createElement("p", null, "原季列表")), empty, ); expect(html).toBe("

原季列表

"); @@ -167,7 +173,7 @@ describe("季集结构:组件", () => { it("作品页:有剧集组时轨道在季列表上方,当前结构显示原来的季与集", () => { const html = withCache( - createElement(EpisodeStructureSwitcher, { entityId: ENTITY, children: createElement("p", null, "原季列表") }), + createElement(EpisodeStructureSwitcher, { entityId: ENTITY }, createElement("p", null, "原季列表")), groups("grp-production"), ); expect(html).toContain("季集结构"); diff --git a/apps/web/app/components/library/episode-structure.tsx b/apps/web/app/components/library/episode-structure.tsx index f27ce556..ef0473cf 100644 --- a/apps/web/app/components/library/episode-structure.tsx +++ b/apps/web/app/components/library/episode-structure.tsx @@ -201,7 +201,7 @@ function resultToast(r: EpisodeGroupSetResult) { * 作品页「季与集」顶部的季集结构切换:只有 TMDB 有剧集组(或作品已选了剧集组)时出现。 * 选中当前结构时显示 children(现有的季与集);选中其它结构时显示该结构的季卡片预览与「改用这套结构」。 */ -export function EpisodeStructureSwitcher({ entityId, children }: { entityId: string; children: ReactNode }) { +export function EpisodeStructureSwitcher({ entityId, children }: { entityId: string; children?: ReactNode }) { const groups = useEpisodeGroups(entityId); const options = structureOptions(groups.data); const current = groups.data?.current?.groupId ?? null;