added translations to SortableItem
This commit is contained in:
@@ -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",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user