"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 Database({
  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="M3.30204 0.785875C4.54182 0.289965 6.20312 0 8 0C9.79688 0 11.4582 0.289965 12.698 0.785875C13.3158 1.033 13.8661 1.34602 14.2742 1.73197C14.6839 2.11942 15 2.63215 15 3.25V8V12.75C15 13.3679 14.6839 13.8806 14.2742 14.268C13.8661 14.654 13.3158 14.967 12.698 15.2141C11.4582 15.71 9.79688 16 8 16C6.20312 16 4.54182 15.71 3.30204 15.2141C2.68423 14.967 2.13394 14.654 1.72583 14.268C1.31613 13.8806 1 13.3679 1 12.75V8V3.25C1 2.63215 1.31613 2.11942 1.72583 1.73197C2.13394 1.34602 2.68423 1.033 3.30204 0.785875ZM2.5 5.33081V8C2.5 8.0725 2.53365 8.21745 2.75649 8.4282C2.98091 8.64044 3.34591 8.86612 3.85913 9.07141C4.8814 9.48032 6.3451 9.75 8 9.75C9.6549 9.75 11.1186 9.48032 12.1409 9.07141C12.6541 8.86612 13.0191 8.64044 13.2435 8.4282C13.4664 8.21745 13.5 8.0725 13.5 8V5.33081C13.2518 5.47297 12.982 5.60051 12.698 5.71412C11.4582 6.21004 9.79688 6.5 8 6.5C6.20312 6.5 4.54182 6.21004 3.30204 5.71412C3.018 5.60051 2.74824 5.47297 2.5 5.33081ZM13.5 3.25C13.5 3.3225 13.4664 3.46746 13.2435 3.6782C13.0191 3.89044 12.6541 4.11612 12.1409 4.32141C11.1186 4.73032 9.6549 5 8 5C6.3451 5 4.8814 4.73032 3.85913 4.32141C3.34591 4.11612 2.98091 3.89044 2.75649 3.6782C2.53365 3.46746 2.5 3.3225 2.5 3.25C2.5 3.1775 2.53365 3.03254 2.75649 2.8218C2.98091 2.60956 3.34591 2.38388 3.85913 2.17859C4.8814 1.76968 6.3451 1.5 8 1.5C9.6549 1.5 11.1186 1.76968 12.1409 2.17859C12.6541 2.38388 13.0191 2.60956 13.2435 2.8218C13.4664 3.03254 13.5 3.1775 13.5 3.25ZM13.5 10.0808C13.2518 10.223 12.982 10.3505 12.698 10.4641C11.4582 10.96 9.79688 11.25 8 11.25C6.20312 11.25 4.54182 10.96 3.30204 10.4641C3.018 10.3505 2.74824 10.223 2.5 10.0808V12.75C2.5 12.8225 2.53365 12.9675 2.75649 13.1782C2.98091 13.3904 3.34591 13.6161 3.85913 13.8214C4.8814 14.2303 6.3451 14.5 8 14.5C9.6549 14.5 11.1186 14.2303 12.1409 13.8214C12.6541 13.6161 13.0191 13.3904 13.2435 13.1782C13.4664 12.9675 13.5 12.8225 13.5 12.75V10.0808Z"
        fill="currentColor"
      />
    </svg>
  );
}
