ohif-viewer/platform/ui-next/src/components/Separator/Separator.tsx

33 lines
864 B
TypeScript

import * as React from "react"
import * as SeparatorPrimitive from "@radix-ui/react-separator"
import { cn } from '../../lib/utils';
type SeparatorProps = React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root> & {
thickness?: string;
};
const Separator = React.forwardRef<
React.ElementRef<typeof SeparatorPrimitive.Root>,
SeparatorProps
>(
(
{ className, orientation = "horizontal", decorative = true, thickness = "1px", ...props },
ref
) => (
<SeparatorPrimitive.Root
ref={ref}
decorative={decorative}
orientation={orientation}
className={cn(
"shrink-0 bg-border",
orientation === "horizontal" ? `h-[${thickness}] w-full` : `h-full w-[${thickness}]`,
className
)}
{...props}
/>
)
)
Separator.displayName = SeparatorPrimitive.Root.displayName
export { Separator }