import { forwardRef } from "react";

/**
 * Separator
 *
 * orientation: "vertical" | (default horizontal)
 * position:    "start" | "end" | (default center)
 * children:    string | ReactNode - divider label (optional)
 */
const Separator = forwardRef(function Separator(
  { orientation, position, className = "", children, ...props },
  ref
) {
  const classes = [
    "prs-separator",
    orientation === "vertical" && "prs-separator-vertical",
    position === "start" && "prs-separator-start",
    position === "end" && "prs-separator-end",
    className,
  ]
    .filter(Boolean)
    .join(" ");

  return (
    <div ref={ref} className={classes} role="separator" {...props}>
      {children}
    </div>
  );
});

export default Separator;
