AI Implementation feature(883): Admin Area General Settings and Categories 1.01 (#23)

This commit was merged in pull request #23.
This commit is contained in:
2026-07-22 12:32:00 +00:00
parent fac3179427
commit 0a2b2664b4
9 changed files with 171 additions and 89 deletions
@@ -1,3 +1,16 @@
export type PageTitleError = 'required' | 'maxlength' | null;
export function pageTitleError(value: string | null | undefined, maxLength = 120): PageTitleError {
const v = value ?? '';
if (v.trim().length === 0) return 'required';
if (v.length > maxLength) return 'maxlength';
return null;
}
export function normalizePageTitle(value: string): string {
return value.trim();
}
export type EventDerivedState = 'running' | 'countdown' | 'stopped' | 'unconfigured';
export function deriveEventState(start: string, end: string): EventDerivedState {