Build Admin pages

This commit is contained in:
NeilClack
2026-02-23 10:21:42 -06:00
parent bec8f57a93
commit a230a1e36d
24 changed files with 1591 additions and 8 deletions
+15
View File
@@ -0,0 +1,15 @@
export function fieldNameToLabel(fieldName: string): string {
const withoutId = fieldName.replace(/Id$/, '');
const spaced = withoutId.replace(/([a-z])([A-Z])/g, '$1 $2');
return spaced.charAt(0).toUpperCase() + spaced.slice(1);
}
export function resolveFieldValue(record: Record<string, unknown>, path: string): unknown {
const parts = path.split('.');
let current: unknown = record;
for (const part of parts) {
if (current == null || typeof current !== 'object') return undefined;
current = (current as Record<string, unknown>)[part];
}
return current;
}