Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 3m21s
CI / OCR Service Tests (pull_request) Successful in 29s
CI / Backend Unit Tests (pull_request) Failing after 3m1s
CI / Unit & Component Tests (push) Failing after 3m28s
CI / OCR Service Tests (push) Successful in 28s
CI / Backend Unit Tests (push) Failing after 3m3s
statusLabel() was a one-line alias for formatDocumentStatus() with no additional behaviour. Remove it and update DocumentStatusChip.svelte to call formatDocumentStatus() directly. Remove the corresponding alias test suite from the spec file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
886 B
TypeScript
36 lines
886 B
TypeScript
import { m } from '$lib/paraglide/messages.js';
|
|
|
|
export type DocumentStatus = 'PLACEHOLDER' | 'UPLOADED' | 'TRANSCRIBED' | 'REVIEWED' | 'ARCHIVED';
|
|
|
|
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();
|
|
}
|
|
}
|
|
|
|
export function statusDotClass(status: DocumentStatus): string {
|
|
switch (status) {
|
|
case 'PLACEHOLDER':
|
|
return 'bg-gray-400';
|
|
case 'UPLOADED':
|
|
return 'bg-emerald-500';
|
|
case 'TRANSCRIBED':
|
|
return 'bg-blue-400';
|
|
case 'REVIEWED':
|
|
return 'bg-amber-400';
|
|
case 'ARCHIVED':
|
|
return 'bg-emerald-600';
|
|
}
|
|
}
|