import { Group, Rect, Line } from 'react-konva';

interface WardrobeSilhouetteProps {
  readonly x: number;
  readonly y: number;
  readonly width: number;
  readonly depth: number;
  readonly rotation: number;
  readonly color: string;
  readonly fillColor: string;
}

/** Top-down wardrobe silhouette: rectangle with center door line and handles. */
export function WardrobeSilhouette({ x, y, width, depth, rotation, color, fillColor }: WardrobeSilhouetteProps) {
  const halfW = width / 2;
  const halfD = depth / 2;

  return (
    <Group x={x} y={y} rotation={rotation}>
      <Rect
        x={-halfW}
        y={-halfD}
        width={width}
        height={depth}
        stroke={color}
        strokeWidth={1.5}
        fill={fillColor}
        listening={false}
      />
      {/* Center divider (door split) */}
      <Line
        points={[0, -halfD, 0, halfD]}
        stroke={color}
        strokeWidth={0.8}
        listening={false}
      />
      {/* Door handles */}
      <Line
        points={[-width * 0.05, -depth * 0.1, -width * 0.05, depth * 0.1]}
        stroke={color}
        strokeWidth={2}
        lineCap="round"
        listening={false}
      />
      <Line
        points={[width * 0.05, -depth * 0.1, width * 0.05, depth * 0.1]}
        stroke={color}
        strokeWidth={2}
        lineCap="round"
        listening={false}
      />
    </Group>
  );
}
