352d899fa5
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
13 lines
324 B
TypeScript
13 lines
324 B
TypeScript
import type { components } from "../api/schema";
|
|
|
|
type LabelView = components["schemas"]["LabelView"];
|
|
|
|
export function labelText(labels: LabelView[], lang: string): string {
|
|
return (
|
|
labels.find((l) => l.lang === lang)?.label ??
|
|
labels.find((l) => l.lang === "en")?.label ??
|
|
labels[0]?.label ??
|
|
""
|
|
);
|
|
}
|