feat(i18n): localize movement UI

This commit is contained in:
2026-06-14 01:20:23 +02:00
parent 7d5ab64653
commit f62cd6fb37
8 changed files with 270 additions and 17 deletions
@@ -1,3 +1,4 @@
import { formatMovementType } from "@/app/(dashboard)/movements/movement.copy"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { getI18n } from "@/i18n/server"
import { AssetService } from "@/services/asset.service"
@@ -15,6 +16,7 @@ export default async function ItemPage({
const movements = await MovementService.findAllByItemId(itemId)
const { dictionary } = await getI18n()
const copy = dictionary.inventory.items.detail
const movementCopy = dictionary.inventory.movements
if (!item) {
return <div>{copy.notFound}</div>
@@ -77,7 +79,7 @@ export default async function ItemPage({
{movements?.length > 0 && (
<Card className="rounded-sm shadow-none">
<CardHeader>
<CardTitle>Movements</CardTitle>
<CardTitle>{movementCopy.snippet.title}</CardTitle>
</CardHeader>
<CardContent>
{movements.map((movement) => (
@@ -86,11 +88,21 @@ export default async function ItemPage({
className="grid grid-cols-2 gap-x-8 gap-y-2 text-sm"
>
<div className="flex justify-between">
<span className="text-gray-600">Type</span>
<span>{movement.type}</span>
<span className="text-gray-600">
{movementCopy.snippet.labels.type}
</span>
<span>
{formatMovementType(
movement.type,
movementCopy.types,
movementCopy.fallback,
)}
</span>
</div>
<div className="flex justify-between">
<span className="text-gray-600">Quantity</span>
<span className="text-gray-600">
{movementCopy.snippet.labels.quantity}
</span>
<span>{movement.quantity}</span>
</div>
</div>