import useLocalStorageState from 'hooks/useLocalStorageState' import { TOKEN_WATCHLIST_KEY } from 'utils/constants' import PinFill from '@components/icons/PinFill' import PinOutline from '@components/icons/PinOutline' const WatchlistButton = ({ tokenIndex, className, }: { tokenIndex: number className?: string }) => { const [watchlist, setWatchlist] = useLocalStorageState( TOKEN_WATCHLIST_KEY, [], ) const toggleWatchlist = (tokenIndex: number) => { const isWatched = watchlist.includes(tokenIndex) if (isWatched) { const newWatchlist = watchlist.filter( (item: number) => item !== tokenIndex, ) setWatchlist(newWatchlist) } else { setWatchlist([...watchlist, tokenIndex]) } } return ( ) } export default WatchlistButton