fix(api): use FocusOptionId union for fact lookup
Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
This commit is contained in:
parent
65df4df348
commit
d8b2d6428e
@ -43,8 +43,10 @@ interface IntakeStep {
|
||||
save: (effects: IntakeEffects, answer: IntakeAnswer) => Promise<void>;
|
||||
}
|
||||
|
||||
export type FocusOptionId = "day" | "inbox" | "research" | "crew";
|
||||
|
||||
export interface FocusOption {
|
||||
id: string;
|
||||
id: FocusOptionId;
|
||||
letter: string;
|
||||
label: string;
|
||||
apps: string[];
|
||||
@ -63,10 +65,10 @@ const FOCUS_FACTS = {
|
||||
research: "Möchte zuerst bei Recherche und Schreiben unterstützt werden",
|
||||
crew: "Möchte eine koordinierte Crew aus Spezialisten-Bots",
|
||||
},
|
||||
} as const satisfies Record<string, Record<FocusOption["id"], string>>;
|
||||
} as const satisfies Record<string, Record<FocusOptionId, string>>;
|
||||
|
||||
/** Profile fact text for a focus answer, in the user's locale (defaults to English). */
|
||||
function isFocusOptionId(id: string): id is FocusOption["id"] {
|
||||
function isFocusOptionId(id: string): id is FocusOptionId {
|
||||
return FOCUS_OPTIONS.some((option) => option.id === id);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user