// shadcn Separator — horizontal / vertical rule.

import type { HTMLAttributes, ReactNode } from 'react'
import { cn } from '../cn'

interface SeparatorProps extends HTMLAttributes<HTMLDivElement> {
  readonly orientation?: 'horizontal' | 'vertical'
}

export const Separator = ({
  className, orientation = 'horizontal', ...props
}: SeparatorProps): ReactNode => (
  <div
    data-slot="separator"
    role="separator"
    aria-orientation={orientation}
    className={cn(
      'bg-border shrink-0',
      orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',
      className,
    )}
    {...props}
  />
)
