"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 Middleware({
  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.46966 3.53032L2.5482 3.60886C1.98451 4.30784 1.5525 5.11744 1.28985 5.99999H2.8749C3.43288 4.57116 4.57113 3.43288 5.99995 2.87488V1.28981C5.11741 1.55247 4.30782 1.9845 3.60885 2.54819L3.53032 2.46966L2.03032 0.969661L1.49999 0.439331L0.439331 1.49999L0.969661 2.03032L2.46966 3.53032ZM7.9801 14.9999L7.99999 14.9999L8.01988 14.9999H7.9801ZM13.4517 12.3911C14.0154 11.6921 14.4474 10.8825 14.7101 9.99999H13.125C12.567 11.4288 11.4288 12.567 9.99995 13.125V14.7101C10.8825 14.4474 11.6921 14.0154 12.391 13.4517L12.4697 13.5303L13.9697 15.0303L14.5 15.5607L15.5607 14.5L15.0303 13.9697L13.5303 12.4697L13.4517 12.3911ZM13.4518 3.60886C14.0155 4.30784 14.4475 5.11744 14.7101 5.99999H13.1251C12.5671 4.57113 11.4288 3.43284 9.99995 2.87484V1.28979C10.8825 1.55245 11.6921 1.98448 12.3911 2.5482L12.4697 2.46966L13.9697 0.969661L14.5 0.439331L15.5607 1.49999L15.0303 2.03032L13.5303 3.53032L13.4518 3.60886ZM1.28989 9.99999H2.87496C3.43296 11.4288 4.57118 12.567 5.99995 13.125V14.71C5.11744 14.4474 4.30788 14.0154 3.60893 13.4517L3.53032 13.5303L2.03032 15.0303L1.49999 15.5607L0.439331 14.5L0.969661 13.9697L2.46966 12.4697L2.54827 12.3911C1.98457 11.6921 1.55255 10.8825 1.28989 9.99999ZM7.99999 9.99999C9.10456 9.99999 9.99999 9.10456 9.99999 7.99999C9.99999 6.89542 9.10456 5.99999 7.99999 5.99999C6.89542 5.99999 5.99999 6.89542 5.99999 7.99999C5.99999 9.10456 6.89542 9.99999 7.99999 9.99999Z"
        fill="currentColor"
      />
    </svg>
  );
}
