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" xmlns="http://www.w3.org/2000/svg" {...props}>
    <path d="M7 3H5V5H7V3Z" />
    <path d="M11 3H9V5H11V3Z" />
    <path d="M7 7H5V9H7V7Z" />
    <path d="M11 7H9V9H11V7Z" />
    <path d="M7 11H5V13H7V11Z" />
    <path d="M11 11H9V13H11V11Z" />
  </svg>
);

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

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