added translations to SortableItem

This commit is contained in:
Laura Dolibois
2025-06-16 20:35:00 +02:00
parent ade4b02959
commit ada0865f95
2 changed files with 10 additions and 3 deletions

View File

@@ -128,5 +128,5 @@
"orderDetails": "Bestelldetails", "orderDetails": "Bestelldetails",
"orderId": "Bestellnummer", "orderId": "Bestellnummer",
"date": "Datum", "date": "Datum",
"moveToNextStatus": "Zum nächsten Status" "moveToNextStatus": "Zum nächsten Status",
} }

View File

@@ -1,6 +1,7 @@
import { useSortable } from "@dnd-kit/sortable"; import { useSortable } from "@dnd-kit/sortable";
import { CSS } from "@dnd-kit/utilities"; import { CSS } from "@dnd-kit/utilities";
import { Paper, Typography, useTheme } from "@mui/material"; import { Paper, Typography, useTheme } from "@mui/material";
import { useTranslation } from "react-i18next";
type SortableItemProps = { type SortableItemProps = {
id: string; id: string;
@@ -12,8 +13,10 @@ type SortableItemProps = {
}; };
export default function SortableItem({ id, order, onClick }: SortableItemProps) { export default function SortableItem({ id, order, onClick }: SortableItemProps) {
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id }); const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id });
const theme = useTheme(); const theme = useTheme();
const { t } = useTranslation();
const style = { const style = {
transform: CSS.Transform.toString(transform), transform: CSS.Transform.toString(transform),
@@ -41,8 +44,12 @@ export default function SortableItem({ id, order, onClick }: SortableItemProps)
}, },
}} }}
> >
<Typography variant="body1">Order ID: {order.id}</Typography> <Typography variant="body1">
<Typography variant="body2">Total: {order.total.toFixed(2)} </Typography> {t("orderId")}: {order.id}
</Typography>
<Typography variant="body2">
{t("total")}: {order.total.toFixed(2)}
</Typography>
</Paper> </Paper>
); );
} }