separator.tsx 760 B

123456789101112131415161718192021
  1. import * as SeparatorPrimitive from '@radix-ui/react-separator';
  2. import * as React from 'react';
  3. import { cn } from '@/common/helpers/cn';
  4. function Separator({ className, orientation = 'horizontal', decorative = true, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
  5. return (
  6. <SeparatorPrimitive.Root
  7. data-slot="separator-root"
  8. decorative={decorative}
  9. orientation={orientation}
  10. className={cn(
  11. 'shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',
  12. className,
  13. )}
  14. {...props}
  15. />
  16. );
  17. }
  18. export { Separator };