2023-12-07 17:08:22 +08:00
|
|
|
import React from 'react';
|
|
|
|
import {Cart} from "./Cart.jsx";
|
|
|
|
import {CrateMode} from "./CrateMode.jsx";
|
|
|
|
import {CrateWarnings} from "./CrateWarnings.jsx";
|
2023-11-30 17:26:17 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Component that displays the main crate with reminder rules.
|
|
|
|
* It includes <Cart> and rules
|
|
|
|
*/
|
2023-12-07 17:08:22 +08:00
|
|
|
export function Crate({data, handleToggleOverlayRemove, handleDeleteItem, handleShowOverlayRemove, handleCardsUpdated, isMobile, isTouch}) {
|
|
|
|
return (
|
|
|
|
<div className="crate">
|
|
|
|
|
|
|
|
<CrateMode current={data.mode} onChange={null} />
|
|
|
|
|
|
|
|
<div className="crate-products">
|
|
|
|
|
|
|
|
<Cart
|
|
|
|
data={data}
|
|
|
|
isMobile={isMobile}
|
|
|
|
isTouch={isTouch}
|
|
|
|
onToggleOverlayRemove={handleToggleOverlayRemove}
|
|
|
|
onClickRemoveItem={handleDeleteItem}
|
|
|
|
onClickItem={handleShowOverlayRemove}
|
|
|
|
onCardUpdate={handleCardsUpdated}>
|
|
|
|
</Cart>
|
|
|
|
|
|
|
|
{1||(rules && rules.length > 0) && (
|
|
|
|
<CrateWarnings/>
|
|
|
|
)}
|
|
|
|
</div>
|
2023-11-30 17:26:17 +08:00
|
|
|
|
2023-12-07 17:08:22 +08:00
|
|
|
</div>
|
|
|
|
);
|
2023-11-30 17:26:17 +08:00
|
|
|
|
|
|
|
}
|