Files
familienarchiv/frontend/src/lib/utils/documentStatusLabel.ts
Marcel 3abdf9bb68 feat(persons): add formatLifeDateRange + formatDocumentStatus utility functions
Unit tests for both; i18n keys for doc status and person stats bar;
PERSON_NOT_FOUND added to frontend ErrorCode type.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 19:50:30 +02:00

23 lines
593 B
TypeScript

import { m } from '$lib/paraglide/messages.js';
/**
* Maps a document status string to a localised human-readable label.
* Falls back to "Unknown" for unrecognised values.
*/
export function formatDocumentStatus(status: string): string {
switch (status) {
case 'PLACEHOLDER':
return m.doc_status_placeholder();
case 'UPLOADED':
return m.doc_status_uploaded();
case 'TRANSCRIBED':
return m.doc_status_transcribed();
case 'REVIEWED':
return m.doc_status_reviewed();
case 'ARCHIVED':
return m.doc_status_archived();
default:
return m.doc_status_unknown();
}
}