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="M1 1H5V2.5H2.5V5H1V1Z" />
    <path d="M15 1H11V2.5H13.5V5H15V1Z" />
    <path d="M1 15H5V13.5H2.5V11H1V15Z" />
    <path d="M15 15H11V13.5H13.5V11H15V15Z" />
  </svg>
);

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

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