"use client";

import React from "react";
import type { CSSProperties } from "react";

import { useIconSize } from "../contexts/IconSizeContext";

type Props = {
  size?: number;
  color?: string;
  style?: CSSProperties;
};

export default function Bug({ color = "currentcolor", size, ...props }: Props) {
  const iconSize = useIconSize();
  const height = size || iconSize.size;
  const width = size || iconSize.size;
  const style = { color, ...props.style };
  return (
    <svg
      {...props}
      data-testid="geist-icon"
      height={height}
      strokeLinejoin="round"
      style={style}
      viewBox="0 0 16 16"
      width={width}
    >
      <path
        fillRule="evenodd"
        clipRule="evenodd"
        d="M2.72939 1.08667L2.91633 1.813C3.14178 2.6889 3.5877 3.47623 4.19131 4.11245C5.10843 2.81983 6.47443 1.99994 8 1.99994C9.52604 1.99994 10.8924 2.82033 11.8095 4.11362C12.4137 3.4772 12.86 2.68944 13.0856 1.813L13.2726 1.08667L14.7252 1.46056L14.5383 2.18689C14.2057 3.47887 13.5005 4.62131 12.5438 5.49247C12.8367 6.25545 13 7.1048 13 7.99994H14.5V9.49994H12.8425C12.6814 10.2508 12.4023 10.9447 12.0303 11.5516L13.5854 12.3291L14 12.5364V12.9999V14.9999H12.5V13.4635L11.0614 12.7442C10.2155 13.5313 9.15334 13.9999 8 13.9999C6.84667 13.9999 5.78454 13.5313 4.93862 12.7442L3.5 13.4635V14.9999H2V12.9999V12.5364L2.41459 12.3291L3.96968 11.5516C3.59767 10.9447 3.31856 10.2508 3.15752 9.49994H1.5V7.99994H3C3 7.10429 3.16354 6.25447 3.45674 5.49115C2.50078 4.62015 1.79604 3.47822 1.46368 2.18689L1.27673 1.46056L2.72939 1.08667ZM4.5 7.99994C4.5 7.42037 4.58029 6.88538 4.72282 6.40189C5.48628 6.82689 6.34086 7.10803 7.25 7.20865V12.388C5.81588 11.9619 4.5 10.3463 4.5 7.99994ZM8.75 12.388C10.1841 11.9619 11.5 10.3463 11.5 7.99994C11.5 7.42074 11.4198 6.88607 11.2775 6.40283C10.5139 6.82761 9.65921 7.10851 8.75 7.20886V12.388ZM8.00098 5.74994C8.96014 5.74994 9.85949 5.49262 10.6336 5.04317C9.94986 4.05908 8.95526 3.49994 8 3.49994C7.04501 3.49994 6.05069 4.05877 5.36701 5.04236C6.14139 5.49231 7.04124 5.74994 8.00098 5.74994Z"
        fill="currentColor"
      />
    </svg>
  );
}
