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

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

/** Top-down TV silhouette: thin rectangle with screen indicator. */
export function TvSilhouette({ x, y, width, depth, rotation, color, fillColor }: TvSilhouetteProps) {
  const halfW = width / 2;
  const halfD = depth / 2;

  return (
    <Group x={x} y={y} rotation={rotation}>
      {/* TV body */}
      <Rect
        x={-halfW}
        y={-halfD}
        width={width}
        height={depth}
        stroke={color}
        strokeWidth={1.5}
        fill={fillColor}
        listening={false}
      />
      {/* Screen line */}
      <Line
        points={[-halfW + width * 0.05, -halfD * 0.5, halfW - width * 0.05, -halfD * 0.5]}
        stroke={color}
        strokeWidth={1}
        listening={false}
      />
      {/* Stand center mark */}
      <Line
        points={[0, halfD * 0.3, 0, halfD]}
        stroke={color}
        strokeWidth={1.5}
        listening={false}
      />
    </Group>
  );
}
