import getPathPrefix from "../../../../utils/getPathPrefix";

function Car({ className, onSelect, onMouseEnter, onMouseLeave }) {
    return (
        <svg
            width="1920"
            height="1080"
            viewBox="0 0 1920 1080"
            fill="none"
            xmlns="http://www.w3.org/2000/svg"
            xmlnsXlink="http://www.w3.org/1999/xlink"
            className={className}
        >
            <g id="game__car">
                <rect
                    className="default"
                    x="1"
                    y="1"
                    width="1918"
                    height="1078"
                    fill="url(#pattern0_16_87)"
                />
                <rect
                    className="done"
                    x="1"
                    y="1"
                    width="1918"
                    height="1078"
                    fill="url(#pattern1_16_87)"
                />
                <rect
                    className="button"
                    x="1390"
                    y="282"
                    width="395"
                    height="291"
                    fill="transparent"
                    onClick={onSelect}
                    onMouseEnter={onMouseEnter}
                    onMouseLeave={onMouseLeave}
                />
            </g>
            <defs>
                <pattern
                    id="pattern0_16_87"
                    patternContentUnits="objectBoundingBox"
                    width="1"
                    height="1"
                >
                    <image
                        xlinkHref={`${getPathPrefix('/images/game/chapter3/car-default.png')}`}
                        transform="scale(0.000520833 0.000925926)"
                    />
                </pattern>
                <pattern
                    id="pattern1_16_87"
                    patternContentUnits="objectBoundingBox"
                    width="1"
                    height="1"
                >
                    <image
                        xlinkHref={`${getPathPrefix('/images/game/chapter3/car-done.png')}`}
                        transform="scale(0.000520833 0.000925926)"
                    />
                </pattern>
            </defs>
        </svg>
    );
}

export default Car;
