← full-stack-fastapi-template / frontend/src/components/ui/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 | function Separator({ |
| 7 | className, |
| 8 | orientation = "horizontal", |
| 9 | decorative = true, |
| 10 | ...props |
| 11 | }: React.ComponentProps<typeof SeparatorPrimitive.Root>) { |
| 12 | return ( |
| 13 | <SeparatorPrimitive.Root |
| 14 | data-slot="separator" |
| 15 | decorative={decorative} |
| 16 | orientation={orientation} |
| 17 | className={cn( |
| 18 | "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", |
| 19 | className |
| 20 | )} |
| 21 | {...props} |
| 22 | /> |
| 23 | ) |
| 24 | } |
| 25 | |
| 26 | export { Separator } |
| 27 |