import { giphyDarkestGrey } from '@giphy/colors' import { IChannel } from '@giphy/js-types' import React, { useContext } from 'react' import styled from 'styled-components' import Avatar_ from '../../attribution/avatar' import VerifiedBadge from '../../attribution/verified-badge' import { CssVars, SearchContext } from '../context' import TrendingIcon_ from './trending-icon' const margin = 9 const ChannelPillContainer = styled.div` background: ${giphyDarkestGrey}; display: flex; padding-right: 4px; align-items: center; margin-right: ${margin}px; cursor: pointer; ` const TrendingSearchPillContainer = styled.div` background: ${giphyDarkestGrey}; display: flex; padding: 14px; align-items: center; margin-right: ${margin}px; white-space: nowrap; cursor: pointer; font-style: italic; border-radius: 20px; ` const Avatar = styled(Avatar_)` height: var(${CssVars.searchbarHeight}); width: var(${CssVars.searchbarHeight}); ` const TrendingIcon = styled(TrendingIcon_)` margin-right: 2px; ` export const ChannelPill = ({ channel }: { channel: IChannel }) => { const { setActiveChannel } = useContext(SearchContext) return ( setActiveChannel(channel)}>
@{channel.user.username}
{channel.user.is_verified && }
) } export const TrendingSearchPill = ({ trendingSearch }: { trendingSearch: string }) => { const { setSearch } = useContext(SearchContext) return ( setSearch(trendingSearch)}> {trendingSearch} ) }