Files
my-pi/pi-minimal-footer/status.ts
T

29 lines
664 B
TypeScript

export const FAST_MODE_STATUS_KEY = "codex-fast-mode";
export interface FooterStatusItem {
text: string;
accent: boolean;
}
/** Convert Pi extension statuses into compact footer segments. */
export function collectFooterStatusItems(
statuses: ReadonlyMap<string, string>,
): FooterStatusItem[] {
const items: FooterStatusItem[] = [];
for (const [key, value] of statuses) {
if (key === FAST_MODE_STATUS_KEY) {
if (value.trim().toLowerCase() === "on") {
items.push({ text: "Fast on", accent: true });
}
continue;
}
if (value.trim()) {
items.push({ text: value, accent: false });
}
}
return items;
}