import { type ReactElement } from "react"
import * as React from "react"
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator"
import { cn } from "@/lib/utils"

export type SeparatorProps = React.ComponentProps<typeof SeparatorPrimitive>

function Separator({
  className,
  orientation = "horizontal",
  ...props
}: SeparatorProps): ReactElement {
  return (
    <SeparatorPrimitive
      className={cn(
        "shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
        className
      )}
      data-orientation={orientation}
      data-slot="separator"
      {...props}
    />
  )
}

export { Separator }
