import styled, { css } from 'styled-components/macro'

import { isMobileDevice } from 'config/userAgent'
import { TooltipWrapper } from 'features/Tooltip'

export const MenuList = styled.ul`
  display: flex;
  ${isMobileDevice
    ? css`
      margin-top: 8px; 
      @media screen and (orientation: landscape){
        margin-right: 5px;
        margin-top: 0;
      }
    `
    : ''};
`

export const MenuItem = styled.li`
  position: relative;
  display: flex;
  height: 2.28rem;
  line-height: 2.28rem;
  cursor: pointer;

  :hover ${TooltipWrapper} {
    display: block;
  }
`

type IconProps = {
  size: string,
  src: string,
}

export const Icon = styled.div<IconProps>`
  width: 2.36rem;
  height: 100%;
  background-image: url(/images/${({ src }) => `${src}.svg`});
  background-repeat: no-repeat;
  background-position: center;
  background-size: ${({ size }) => size};
  opacity: 0.8;
  ${isMobileDevice
    ? css`
      width: 16px;
      height: 16px;
      background-size: contain;
      /* margin: 0 4px; */
      :only-child {
        margin: 0 4px;
      }

      @media screen and (orientation: landscape){
        width: 21px;
        height: 21px;
      }
    `
    : ''};

  &:hover {
    opacity: 1;
  }
`
