fix tto order tables

This commit is contained in:
Danel Kungla
2025-10-22 10:29:07 +03:00
parent deee61e3ff
commit 86b2d02a8f
13 changed files with 130 additions and 71 deletions

View File

@@ -18,19 +18,19 @@ const MobileCartItems = ({
productColumnLabelKey: string;
}) => {
const {
i18n: { language },
i18n: { language, t },
} = useTranslation();
return (
<Table className="border-separate rounded-lg border p-2">
<TableBody>
<MobileTableRow
titleKey={productColumnLabelKey}
title={t(productColumnLabelKey)}
value={item.product_title}
/>
<MobileTableRow titleKey="cart:table.time" value={item.quantity} />
<MobileTableRow title={t('cart:table.time')} value={item.quantity} />
<MobileTableRow
titleKey="cart:table.price"
title={t('cart:table.price')}
value={formatCurrency({
value: item.unit_price,
currencyCode,
@@ -38,7 +38,7 @@ const MobileCartItems = ({
})}
/>
<MobileTableRow
titleKey="cart:table.total"
title={t('cart:table.total')}
value={
item.total &&
formatCurrency({

View File

@@ -25,27 +25,30 @@ const MobileCartServiceItems = ({
setEditingItem: (item: EnrichedCartItem | null) => void;
}) => {
const {
i18n: { language },
i18n: { language, t },
} = useTranslation();
return (
<Table className="border-separate rounded-lg border p-2">
<TableBody>
<MobileTableRow
titleKey={productColumnLabelKey}
title={t(productColumnLabelKey)}
value={item.product_title}
/>
<MobileTableRow
titleKey="cart:table.time"
title={t('cart:table.time')}
value={formatDateAndTime(item.reservation.startTime.toString())}
/>
<MobileTableRow
titleKey="cart:table.location"
title={t('cart:table.location')}
value={item.reservation.location?.address ?? '-'}
/>
<MobileTableRow titleKey="cart:table.quantity" value={item.quantity} />
<MobileTableRow
titleKey="cart:table.price"
title={t('cart:table.quantity')}
value={item.quantity}
/>
<MobileTableRow
title={t('cart:table.price')}
value={formatCurrency({
value: item.unit_price,
currencyCode,
@@ -53,7 +56,7 @@ const MobileCartServiceItems = ({
})}
/>
<MobileTableRow
titleKey="cart:table.total"
title={t('cart:table.total')}
value={
item.total &&
formatCurrency({

View File

@@ -1,19 +1,16 @@
import React from 'react';
import { Trans } from '@kit/ui/makerkit/trans';
import { TableCell, TableHead, TableRow } from '@kit/ui/shadcn/table';
const MobleTableRow = ({
titleKey,
title,
value,
}: {
titleKey?: string;
title?: string;
value?: string | number;
}) => (
<TableRow>
<TableHead className="h-2 font-bold">
<Trans i18nKey={titleKey} />
</TableHead>
<TableHead className="h-2 font-bold">{title}</TableHead>
<TableCell className="p-0 text-right">
<p className="txt-medium-plus text-ui-fg-base">{value}</p>