added translations to OrdersInfo
This commit is contained in:
@@ -123,5 +123,10 @@
|
||||
"delete": "Löschen",
|
||||
"pleaseEnterPassword": "Bitte Passwort eingeben",
|
||||
"mainAdminMenu": "Admin-Hauptmenü",
|
||||
"uuid": "UUID"
|
||||
"uuid": "UUID",
|
||||
"Orders Management": "Bestellverwaltung",
|
||||
"orderDetails": "Bestelldetails",
|
||||
"orderId": "Bestellnummer",
|
||||
"date": "Datum",
|
||||
"moveToNextStatus": "Zum nächsten Status"
|
||||
}
|
||||
|
||||
@@ -123,5 +123,10 @@
|
||||
"delete": "Delete",
|
||||
"pleaseEnterPassword": "Please enter password",
|
||||
"mainAdminMenu": "Main Administration Menu",
|
||||
"uuid": "UUID"
|
||||
"uuid": "UUID",
|
||||
"Orders Management": "Orders Management",
|
||||
"orderDetails": "Order Details",
|
||||
"orderId": "Order Number",
|
||||
"date": "Date",
|
||||
"moveToNextStatus": "Move to Next Status"
|
||||
}
|
||||
@@ -61,14 +61,16 @@ const mockOrders: OrderType[] = [
|
||||
}
|
||||
];
|
||||
|
||||
// The order in which the statuses are displayed
|
||||
const statusOrder: OrderStatusEnum[] = [
|
||||
OrderStatusEnum.CANCELLED,
|
||||
OrderStatusEnum.ISSUES,
|
||||
OrderStatusEnum.ORDERED,
|
||||
OrderStatusEnum.IN_PROGRESS,
|
||||
OrderStatusEnum.CANCELLED,
|
||||
OrderStatusEnum.ISSUES,
|
||||
OrderStatusEnum.ORDERED,
|
||||
OrderStatusEnum.IN_PROGRESS,
|
||||
OrderStatusEnum.DELIVERED
|
||||
];
|
||||
|
||||
// Main component for managing orders
|
||||
export default function OrdersInfo() {
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
@@ -112,14 +114,12 @@ export default function OrdersInfo() {
|
||||
bgcolor: theme.palette.background.paper,
|
||||
border: `1px solid ${theme.palette.divider}`,
|
||||
borderRadius: 2
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
<Typography
|
||||
variant="h6"
|
||||
align="center"
|
||||
gutterBottom
|
||||
sx={{ color: theme.palette.text.primary }}
|
||||
>
|
||||
sx={{ color: theme.palette.text.primary }}>
|
||||
{t(status.toString())}
|
||||
</Typography>
|
||||
{filtered.map((order) => (
|
||||
@@ -137,7 +137,7 @@ export default function OrdersInfo() {
|
||||
return (
|
||||
<Box>
|
||||
<Typography variant="h4" align="center" gutterBottom>
|
||||
{t("Orders Management")}
|
||||
{t("Orders Management")} {/* Bestellverwaltung */}
|
||||
</Typography>
|
||||
|
||||
<DndContext
|
||||
@@ -155,21 +155,21 @@ export default function OrdersInfo() {
|
||||
</DndContext>
|
||||
|
||||
<Dialog open={!!selectedOrder} onClose={() => setSelectedOrder(null)}>
|
||||
<DialogTitle>Order Details</DialogTitle>
|
||||
<DialogTitle>{t("orderDetails")}</DialogTitle> {/* Bestelldetails */}
|
||||
<DialogContent sx={{ bgcolor: theme.palette.background.paper }}>
|
||||
{selectedOrder && (
|
||||
<Box sx={{ color: theme.palette.text.primary }}>
|
||||
<Typography variant="body1">
|
||||
<strong>Order ID:</strong> {selectedOrder.id}
|
||||
<strong>{t("orderId")}:</strong> {selectedOrder.id}
|
||||
</Typography>
|
||||
<Typography variant="body1">
|
||||
<strong>Date:</strong> {selectedOrder.date}
|
||||
<strong>{t("date")}:</strong> {selectedOrder.date}
|
||||
</Typography>
|
||||
<Typography variant="body1">
|
||||
<strong>Address:</strong> {selectedOrder.address}
|
||||
<strong>{t("address")}:</strong> {selectedOrder.address}
|
||||
</Typography>
|
||||
<Typography variant="body1" sx={{ mt: 2 }}>
|
||||
<strong>Items:</strong>
|
||||
<strong>{t("items")}:</strong>
|
||||
</Typography>
|
||||
{selectedOrder.items.map((item, idx) => (
|
||||
<Typography key={idx} variant="body2">
|
||||
@@ -177,7 +177,7 @@ export default function OrdersInfo() {
|
||||
</Typography>
|
||||
))}
|
||||
<Typography variant="body1" sx={{ mt: 2 }}>
|
||||
<strong>Total:</strong> {selectedOrder.total.toFixed(2)} €
|
||||
<strong>{t("total")}:</strong> {selectedOrder.total.toFixed(2)} €
|
||||
</Typography>
|
||||
<Button
|
||||
variant="contained"
|
||||
@@ -186,12 +186,12 @@ export default function OrdersInfo() {
|
||||
onClick={() => {
|
||||
handleNextStatus(selectedOrder);
|
||||
setSelectedOrder(null);
|
||||
}}
|
||||
>
|
||||
Move to Next Status
|
||||
}}>
|
||||
{t("moveToNextStatus")} {/* Zum nächsten Status bewegen */}
|
||||
</Button>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user