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="M4.5 3.5C4.77614 3.5 5 3.27614 5 3C5 2.72386 4.77614 2.5 4.5 2.5C4.22386 2.5 4 2.72386 4 3C4 3.27614 4.22386 3.5 4.5 3.5Z" />
    <path d="M13 5H3C2.73487 4.99972 2.48068 4.89428 2.2932 4.7068C2.10572 4.51932 2.00028 4.26513 2 4V2C2.00028 1.73487 2.10572 1.48068 2.2932 1.2932C2.48068 1.10572 2.73487 1.00028 3 1H13C13.2651 1.00028 13.5193 1.10572 13.7068 1.2932C13.8943 1.48068 13.9997 1.73487 14 2V4C13.9997 4.26513 13.8943 4.51932 13.7068 4.7068C13.5193 4.89428 13.2651 4.99972 13 5ZM3 2V4H13V2H3Z" />
    <path d="M4.5 8.5C4.77614 8.5 5 8.27614 5 8C5 7.72386 4.77614 7.5 4.5 7.5C4.22386 7.5 4 7.72386 4 8C4 8.27614 4.22386 8.5 4.5 8.5Z" />
    <path d="M13 10H3C2.73487 9.99972 2.48068 9.89428 2.2932 9.7068C2.10572 9.51932 2.00028 9.26513 2 9V7C2.00028 6.73487 2.10572 6.48068 2.2932 6.2932C2.48068 6.10572 2.73487 6.00028 3 6H13C13.2651 6.00028 13.5193 6.10572 13.7068 6.2932C13.8943 6.48068 13.9997 6.73487 14 7V9C13.9997 9.26513 13.8943 9.51932 13.7068 9.7068C13.5193 9.89428 13.2651 9.99972 13 10ZM3 7V9H13V7H3Z" />
    <path d="M4.5 13.5C4.77614 13.5 5 13.2761 5 13C5 12.7239 4.77614 12.5 4.5 12.5C4.22386 12.5 4 12.7239 4 13C4 13.2761 4.22386 13.5 4.5 13.5Z" />
    <path d="M13 15H3C2.73487 14.9997 2.48068 14.8943 2.2932 14.7068C2.10572 14.5193 2.00028 14.2651 2 14V12C2.00028 11.7349 2.10572 11.4807 2.2932 11.2932C2.48068 11.1057 2.73487 11.0003 3 11H13C13.2651 11.0003 13.5193 11.1057 13.7068 11.2932C13.8943 11.4807 13.9997 11.7349 14 12V14C13.9997 14.2651 13.8943 14.5193 13.7068 14.7068C13.5193 14.8943 13.2651 14.9997 13 15ZM3 12V14H13V12H3Z" />
  </svg>
);

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

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