Files
adilalloandCursor bcbc6f30d9 Import the remade decks on stable ids and recommend one card per job, so a saved draft still loads after a chip is renamed.
The real-group profiles stay as a test, so a change that moves a pick fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-04 14:22:54 -07:00

32 lines
1.0 KiB
TypeScript

import type { CommunityRuleSection } from "../../app/components/type/CommunityRule/CommunityRule.types";
import sharedTerms from "../../messages/en/create/sharedTerms.json";
/** Fixed at launch. Cards that omit a consensus level read this share. */
export const LAUNCH_SUPERMAJORITY_SHARE = 75;
type SharedTerm = { term: string; meaning: string };
/**
* Every shared term, definitions only. Fallbacks for a skipped topic do not print.
* Use-case example Rules do not call this.
*/
export function sharedTermsSection(): CommunityRuleSection {
const terms = (sharedTerms as { terms: SharedTerm[] }).terms;
return {
categoryName: sharedTerms.sectionTitle,
entries: terms.map((term) => ({
title: term.term,
body: term.meaning,
})),
};
}
export function withSharedTerms(
sections: CommunityRuleSection[],
): CommunityRuleSection[] {
if (sections.some((section) => section.categoryName === sharedTerms.sectionTitle)) {
return sections;
}
return [...sections, sharedTermsSection()];
}