// Rôle : affiche le switch global de position des notifications internes.
import React from "react";
import { Icon } from "./Icon.jsx";

export function ToastPositionSwitch({ position, labels, onChange }) {
  const normalizedPosition = position === "left" ? "left" : "right";
  return (
    <button
      className="toast-position-switch"
      type="button"
      data-position={normalizedPosition}
      onClick={() => onChange(normalizedPosition === "left" ? "right" : "left")}
      aria-label={normalizedPosition === "left" ? labels.left : labels.right}
      title={labels.title}
    >
      <span><Icon name="toast-left" /></span>
      <span><Icon name="toast-right" /></span>
    </button>
  );
}
