cat.name === activeCategory) * 100
}%)`,
height: `${100 / categories.length}%`,
}}
/>
{categories.map((cat) => {
return (
)
})}
)
}
export const FavoriteMarketButton = ({ market }) => {
const [favoriteMarkets, setFavoriteMarkets] = useLocalStorageState(
FAVORITE_MARKETS_KEY,
[]
)
const addToFavorites = (mkt) => {
const newFavorites = [...favoriteMarkets, mkt]
setFavoriteMarkets(newFavorites)
}
const removeFromFavorites = (mkt) => {
setFavoriteMarkets(favoriteMarkets.filter((m) => m.name !== mkt.name))
}
return favoriteMarkets.find((mkt) => mkt.name === market.name) ? (
) : (
)
}