import styled, { CSSObject } from "styled-components";
import { colors, theme } from "data/dataMx";

interface IStylesProps {
  width: string;
  minWidth: string;
  disabled: boolean;
  styles?: CSSObject;
  arrowColor?: colors;
}

export const GeneralStyledBtn = styled.button`
  ${({ styles }) => styles}
  cursor: pointer;
  align-items: center;
  background-color: ${theme.transparent};
  border-radius: 4px;
  border: none;
  color: ${theme.neutral600};
  display: flex;
  font-size: 14px;
  font-weight: 700;
  height: 22px;
  outline: none;
  justify-content: start;
  letter-spacing: 0.5px;
  line-height: 16px;
  width: ${({ width }: IStylesProps) => width};
  min-width: ${({ minWidth }: IStylesProps) => minWidth};

  &:hover {
    label{
      color: ${({ disabled, arrowColor }: IStylesProps) =>
        disabled ? theme.neutral500 : theme.neutral700};
    }

    svg{
      fill: ${({ disabled, arrowColor }: IStylesProps) =>
        disabled ? theme.neutral500 : arrowColor ?? theme.neutral700};
    }
  }

  &:active {
    label{
      color: ${({ disabled }: IStylesProps) =>
        disabled ? theme.neutral500 : theme.neutral700};
    }

    svg{
      fill: ${({ disabled }: IStylesProps) =>
        disabled ? theme.neutral500 : theme.neutral700};
    }
  }
`;
