feat(MED-100): show analysis packages and analyses in separate block from tto services

This commit is contained in:
2025-08-25 11:50:47 +03:00
parent e8e762e7ee
commit 1d1b10d094
4 changed files with 28 additions and 21 deletions

View File

@@ -22,12 +22,12 @@ const IS_DISCOUNT_SHOWN = false as boolean;
export default function Cart({
cart,
analysisPackages,
otherItems,
synlabAnalyses,
ttoServiceItems,
}: {
cart: StoreCart | null
analysisPackages: StoreCartLineItem[];
otherItems: StoreCartLineItem[];
synlabAnalyses: StoreCartLineItem[];
ttoServiceItems: StoreCartLineItem[];
}) {
const { i18n: { language } } = useTranslation();
@@ -68,13 +68,13 @@ export default function Cart({
}
const hasCartItems = Array.isArray(cart.items) && cart.items.length > 0;
const isLocationsShown = analysisPackages.length > 0;
const isLocationsShown = synlabAnalyses.length > 0;
return (
<div className="grid grid-cols-1 small:grid-cols-[1fr_360px] gap-x-40 lg:px-4">
<div className="flex flex-col bg-white gap-y-6">
<CartItems cart={cart} items={analysisPackages} productColumnLabelKey="cart:items.analysisPackages.productColumnLabel" />
<CartItems cart={cart} items={otherItems} productColumnLabelKey="cart:items.services.productColumnLabel" />
<CartItems cart={cart} items={synlabAnalyses} productColumnLabelKey="cart:items.synlabAnalyses.productColumnLabel" />
<CartItems cart={cart} items={ttoServiceItems} productColumnLabelKey="cart:items.ttoServices.productColumnLabel" />
</div>
{hasCartItems && (
<div className="flex justify-end gap-x-4 px-6 py-4">
@@ -121,7 +121,7 @@ export default function Cart({
</h5>
</CardHeader>
<CardContent>
<AnalysisLocation cart={{ ...cart }} analysisPackages={analysisPackages} />
<AnalysisLocation cart={{ ...cart }} synlabAnalyses={synlabAnalyses} />
</CardContent>
</Card>
)}