import React from 'react'; import {v4 as uuidv4} from "uuid"; import {Droppable} from "@hello-pangea/dnd"; import {ProductItem} from "./ProductItem.jsx"; import {useShopStore} from "./shop_store"; /** * Component that renders the backlog in the aside */ export function Backlog() { const { currency, data, items, onClickAddItem, onClickToggleMobileSideMenu, isMobile, } = useShopStore(state=> ({ currency: state.currency, data: state.groups, items: state.cards, onClickAddItem: state.addCardFromBacklog, onClickToggleMobileSideMenu: state.switchSideMenu, isMobile: state.isMobile })); const ordered_groups = data.categories.map(groupItem => ({ name: groupItem.name, items: groupItem.itemIds.map(itemId => items[itemId]) })); let item_index = -1; const groups = ordered_groups.map((group, g_index) => { return (