separator.jsx 600 B

1234567891011121314151617181920212223
  1. import * as React from "react"
  2. import * as SeparatorPrimitive from "@radix-ui/react-separator"
  3. import { cn } from "@/lib/utils"
  4. const Separator = React.forwardRef((
  5. { className, orientation = "horizontal", decorative = true, ...props },
  6. ref
  7. ) => (
  8. <SeparatorPrimitive.Root
  9. ref={ref}
  10. decorative={decorative}
  11. orientation={orientation}
  12. className={cn(
  13. "shrink-0 bg-border",
  14. orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
  15. className
  16. )}
  17. {...props} />
  18. ))
  19. Separator.displayName = SeparatorPrimitive.Root.displayName
  20. export { Separator }