separator.tsx

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