import { jsx, jsxs } from "react/jsx-runtime";
import styled, { css } from "styled-components";
import { Text } from "@gympass/yoga";
import Icon from "../../../Icon";
import Box from "../../../Box";
const StyledText = styled(Text.SmallestException)`
  ${({
  theme: {
    yoga: {
      components: {
        navigationmenu: { font }
      }
    }
  }
}) => css`
      color: ${font.color.default};
      max-width: 100%;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    `}
`;
const Active = css`
  ${({
  theme: {
    yoga: {
      components: {
        navigationmenu: { backgroundColor, icon, font }
      }
    }
  }
}) => css`
      background-color: ${backgroundColor.active};

      :not(:last-child) {
        pointer-events: none;
      }

      div {
        ${StyledText} {
          color: ${font.color.active};
          font-weight: ${font.weight.bold};
        }

        svg {
          fill: ${icon.fill.active};
        }
      }
    `}
`;
const StyledItem = styled.li`
  ${({
  isActive,
  theme: {
    yoga: {
      components: {
        navigationmenu: { backgroundColor, border, icon, font }
      }
    }
  }
}) => css`
      transition: background-color 300ms ease-in-out;

      border-radius: ${border.radius.default}px;
      list-style-type: none;
      cursor: pointer;

      svg {
        height: ${icon.height}px;
        width: ${icon.width}px;
        fill: ${icon.fill.default};
      }

      &:hover,
      &:focus {
        ${!isActive && css`
          background-color: ${backgroundColor.hover};

          ${StyledText} {
            color: ${font.color.hover};
          }

          svg {
            fill: ${icon.fill.hover};
          }
        `};
      }

      a {
        text-decoration: none;

        &.active {
          cursor: auto;

          ${Active}
        }
      }

      ${isActive && Active};
    `}
`;
const StyledTextContainer = styled(Box)`
  ${({
  theme: {
    yoga: {
      components: {
        navigationmenu: { border, gap, padding }
      }
    }
  }
}) => css`
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: ${gap.xxxsmall}px;
      padding: ${padding.xxxsmall}px;
      border-radius: ${border.radius.default}px;
    `}
`;
const BottomItem = ({
  active = false,
  icon,
  label,
  wrapper: Wrapper
}) => {
  return /* @__PURE__ */ jsx(StyledItem, { isActive: active, children: /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsxs(StyledTextContainer, { children: [
    /* @__PURE__ */ jsx(Icon, { as: icon }),
    /* @__PURE__ */ jsx(StyledText, { children: label })
  ] }) }) });
};
var BottomItem_default = BottomItem;
export {
  BottomItem_default as default
};
