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="M14 4H12V2C11.9997 1.73489 11.8942 1.48072 11.7067 1.29326C11.5193 1.10579 11.2651 1.00033 11 1H2C1.73489 1.00033 1.48072 1.10579 1.29326 1.29326C1.10579 1.48072 1.00033 1.73489 1 2V11C1.00033 11.2651 1.10579 11.5193 1.29326 11.7067C1.48072 11.8942 1.73489 11.9997 2 12H4V14C4.00033 14.2651 4.10579 14.5193 4.29326 14.7067C4.48072 14.8942 4.73488 14.9997 5 15H14C14.2651 14.9997 14.5193 14.8942 14.7067 14.7067C14.8942 14.5193 14.9997 14.2651 15 14V5C14.9997 4.73488 14.8942 4.48072 14.7067 4.29326C14.5193 4.10579 14.2651 4.00033 14 4ZM11 11H7V8.5H11V11ZM11 7.5H7V5H11V7.5ZM6 7.5H2V5H6V7.5ZM11 2V4H2V2H11ZM2 11V8.5H6V11H2ZM14 14H5V12H11C11.2651 11.9997 11.5193 11.8942 11.7067 11.7067C11.8942 11.5193 11.9997 11.2651 12 11V5H14V14Z" />
  </svg>
);

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

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