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

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

/** Top-down desk silhouette: rectangle with chair indent area. */
export function DeskSilhouette({ x, y, width, depth, rotation, color, fillColor }: DeskSilhouetteProps) {
  const halfW = width / 2;
  const halfD = depth / 2;

  return (
    <Group x={x} y={y} rotation={rotation}>
      {/* Desk surface */}
      <Rect
        x={-halfW}
        y={-halfD}
        width={width}
        height={depth}
        stroke={color}
        strokeWidth={1.5}
        fill={fillColor}
        listening={false}
      />
      {/* Drawer line */}
      <Line
        points={[-halfW + width * 0.6, -halfD + depth * 0.15, -halfW + width * 0.6, halfD - depth * 0.15]}
        stroke={color}
        strokeWidth={0.8}
        listening={false}
      />
      {/* Drawer handle dot */}
      <Line
        points={[-halfW + width * 0.65, 0, -halfW + width * 0.68, 0]}
        stroke={color}
        strokeWidth={2}
        lineCap="round"
        listening={false}
      />
    </Group>
  );
}
