feat(api): limits read unifiedWindows, unknown seven-day windows labelled by model
This commit is contained in:
+11
-1
@@ -6,8 +6,18 @@ export const LIMIT_LABELS: Record<string, string> = {
|
||||
seven_day_sonnet: "7-day · Sonnet",
|
||||
};
|
||||
|
||||
const SEVEN_DAY = "seven_day_";
|
||||
|
||||
export function limitLabel(window: string): string {
|
||||
return LIMIT_LABELS[window] ?? window;
|
||||
const known = LIMIT_LABELS[window];
|
||||
if (known) {
|
||||
return known;
|
||||
}
|
||||
if (window.startsWith(SEVEN_DAY)) {
|
||||
const model = window.slice(SEVEN_DAY.length);
|
||||
return `7-day · ${model.charAt(0).toUpperCase()}${model.slice(1)}`;
|
||||
}
|
||||
return window.replaceAll("_", " ");
|
||||
}
|
||||
|
||||
// The status as a word, for the windows the API never puts a figure on.
|
||||
|
||||
Reference in New Issue
Block a user