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>
23 lines
593 B
TypeScript
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();
|
|
}
|
|
}
|