separator.tsx 707 B

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