Files
community-rule/lib/create/methodCardCustomizeMetaPatch.ts
2026-05-08 20:32:24 -06:00

20 lines
595 B
TypeScript

import type { CreateFlowState } from "../../app/(app)/create/types";
import type { MethodCardHeaderDraft } from "./methodCardCustomizeSession";
/**
* Merges edited customize header strings into persisted method-card meta.
*/
export function methodCardMetaWithCustomizeHeader(
existing: CreateFlowState["customMethodCardMetaById"],
pendingCardId: string,
header: MethodCardHeaderDraft,
): NonNullable<CreateFlowState["customMethodCardMetaById"]> {
return {
...(existing ?? {}),
[pendingCardId]: {
label: header.title,
supportText: header.description,
},
};
}