import React from 'react'; import {useShopStore} from "./shop_store"; /** * Component that displays crate modes */ export function CrateMode({crate_index}) { const {modes_order, crate_modes, crate, setMode} = useShopStore(state => ({ modes_order: state.modes_order, crate_modes: state.crate_modes, crate: state.crates[crate_index].crate_mode, setMode: state.setCrateMode })) return (
{modes_order.map((mode_name, _) => ( setMode(crate.id, mode_name)} href="#" role="button">{crate_modes[mode_name].name} ))}
); }