added translations to SortableItem
This commit is contained in:
@@ -128,5 +128,5 @@
|
||||
"orderDetails": "Bestelldetails",
|
||||
"orderId": "Bestellnummer",
|
||||
"date": "Datum",
|
||||
"moveToNextStatus": "Zum nächsten Status"
|
||||
"moveToNextStatus": "Zum nächsten Status",
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useSortable } from "@dnd-kit/sortable";
|
||||
import { CSS } from "@dnd-kit/utilities";
|
||||
import { Paper, Typography, useTheme } from "@mui/material";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
type SortableItemProps = {
|
||||
id: string;
|
||||
@@ -12,8 +13,10 @@ type SortableItemProps = {
|
||||
};
|
||||
|
||||
export default function SortableItem({ id, order, onClick }: SortableItemProps) {
|
||||
|
||||
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id });
|
||||
const theme = useTheme();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const style = {
|
||||
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="body2">Total: {order.total.toFixed(2)} €</Typography>
|
||||
<Typography variant="body1">
|
||||
{t("orderId")}: {order.id}
|
||||
</Typography>
|
||||
<Typography variant="body2">
|
||||
{t("total")}: {order.total.toFixed(2)} €
|
||||
</Typography>
|
||||
</Paper>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user