import React from 'react' import {Accordion} from "react-bootstrap"; import {Crate} from "./Crate"; import {useShopStore} from "./shop_store"; export function CrateList() { const { crates, active_crate, onAddCrate, setActiveCrate, } = useShopStore(state=> ({ crates: state.crates, active_crate: state.active_crate, onAddCrate: state.newCrate, setActiveCrate: state.setActiveCrate, })); return ( {crates.map((crate, index) => setActiveCrate(crate.id)}>Crate #{`${index}`} )} Add new crate add ) }