import { TRANSITION_STYLE } from "../constants";
import type { OrganSvgProps } from "../types";

export function Lung({ style, colorScale, isActive = false, className }: OrganSvgProps) {
  const defaultColor = colorScale[100];
  const activeColor = colorScale[200];
  const fill = style?.fill ?? (isActive ? activeColor : defaultColor);

  return (
    <g className={className} data-organ="lung">
      <path
        d={LUNG_PATH}
        fill={fill}
        stroke={style?.stroke}
        strokeWidth={(style?.strokeWidth ?? 1) * 0.5}
        style={{ transition: TRANSITION_STYLE }}
      />
    </g>
  );
}

const LUNG_PATH =
  "M33.2828 0.0025112C34.8699 -0.0415173 36.4163 0.498309 37.7942 1.23643C41.7016 3.32998 44.4353 6.95516 46.5401 10.7125C50.8835 18.4641 53.087 27.4944 51.4705 36.133C51.331 36.8657 51.162 37.6098 50.7492 38.2378C49.2896 40.4796 45.7773 40.2429 43.1493 39.389C39.8294 38.3092 36.7069 36.6893 33.9568 34.6234C32.1892 33.2956 30.5377 31.7193 29.7004 29.736C29.1133 28.3422 28.9683 26.8159 28.8579 25.3231C28.6253 22.249 28.5258 19.153 28.4909 16.0515L28.4793 12.8552C28.4793 10.4975 28.4977 8.14536 28.5036 5.7987C28.5036 4.504 28.549 3.14229 29.2526 2.03491C30.0724 0.745774 31.6954 0.0465851 33.2828 0.0025112Z";
