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