import React from 'react';
import styled from 'styled-components';

import type { IconProps } from '@redocly/theme/icons/types';

import { getCssColorVariable } from '@redocly/theme/core/utils';

const Icon = (props: IconProps) => (
  <svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
    <path d="M2 9V10H5.293L1 14.291L1.707 15L6 10.707V14H7V9H2Z" />
    <path d="M15 1.708L14.296 1L10 5.293V2H9V7H14V6H10.707L15 1.708Z" />
  </svg>
);

export const MinimizeIcon = styled(Icon).attrs(() => ({
  'data-component-name': 'icons/MinimizeIcon/MinimizeIcon',
}))<IconProps>`
  path {
    fill: ${({ color }) => getCssColorVariable(color)};
  }

  height: ${({ size }) => size || '16px'};
  width: ${({ size }) => size || '16px'};
`;
