{selectedItems.map((item, index) => (
Selection {index + 1}
{selectedItems.length > 2 && (
}
onClick={() => removeSelectionItem(item.id)}
className="remove-selection-btn"
danger
/>
)}
{/* Radio for merge type */}
updateSelectionType(item.id, e.target.value)}
className="merge-radio-group"
>
Whole Table
Multiple Chairs
{/* Table selection */}
({
value: option.TableId,
label: option.TableName,
})) || []}
label={}
optionsNames={{ value: "TypeId", label: "TypeName" }}
className="merge-dropdown"
isOnchanges={!!item.tableId}
onChangeFunction={(selectedValues) => {
updateTableSelection(item.id, selectedValues);
}}
valueData={item.tableId}
/>
{/* Chair selection if type = chair */}
{item.type === "chair" && item.tableData && (
{item.tableData.ChairLevelSerDetails?.filter(chair => chair.SalesStatus === "Y").map(chair => (
{
const newChairIds = e.target.checked
? [...item.chairIds, chair.ChairId]
: item.chairIds.filter(id => id !== chair.ChairId);
updateChairSelection(item.id, newChairIds);
}}
>
{chair.ChairName}
Order: {chair.OrderId}
))}
)}
{/* Selection summary */}
{item.type === 'table' && item.tableData && (
Table: {item.tableData.TableName}
Order ID: {item.orderId}
)}
{item.type === 'chair' && item.chairIds.length > 0 && (
Selected Chairs: {item.chairIds.length}
Order IDs:
{item.orderIds?.map((orderId, idx) => (
{orderId}
))}
)}
))}
{/* Add more selection button */}