feat(ui): display laterality side in zone badges
Pass t() into describeZone and append (G/D or L/R) when z.side is set. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
5a19ae1f32
commit
3323d4e45d
1 file changed
+8
-1
@@ -46,6 +46,7 @@ function describeZone(
|
||||
z: ObservationZone,
|
||||
bones: Map<string, Bone>,
|
||||
locale: Locale,
|
||||
t: (key: string) => string,
|
||||
): string {
|
||||
const label = boneLabel(bones.get(z.boneId), locale, z.boneId)
|
||||
if (z.vertebrae?.length) {
|
||||
@@ -54,6 +55,12 @@ function describeZone(
|
||||
.join(', ')
|
||||
return `${label} (${vs})`
|
||||
}
|
||||
if (z.side) {
|
||||
const sideLabel = t(
|
||||
z.side === 'left' ? 'lateral.left_short' : 'lateral.right_short',
|
||||
)
|
||||
return `${label} (${sideLabel})`
|
||||
}
|
||||
return label
|
||||
}
|
||||
|
||||
@@ -245,7 +252,7 @@ export default function ObservationCard({
|
||||
return (
|
||||
<li key={`${z.boneId}-${i}`}>
|
||||
<Badge tone="accent" className="gap-2">
|
||||
{describeZone(z, bones, locale)}
|
||||
{describeZone(z, bones, locale, t)}
|
||||
{supportsVertebrae && (
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in new issue
Block a user