tasko/components/ui/separator.tsx

32 lines
779 B
TypeScript
Raw Permalink Normal View History

2024-02-16 01:49:19 +00:00
'use client';
2024-02-15 02:30:10 +00:00
2024-02-16 01:49:19 +00:00
import * as React from 'react';
import * as SeparatorPrimitive from '@radix-ui/react-separator';
2024-02-15 02:30:10 +00:00
2024-02-16 01:49:19 +00:00
import { cn } from '@/lib/utils';
2024-02-15 02:30:10 +00:00
const Separator = React.forwardRef<
2024-11-01 01:58:40 +00:00
React.ComponentRef<typeof SeparatorPrimitive.Root>,
2024-02-15 02:30:10 +00:00
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
>(
(
2024-02-16 01:49:19 +00:00
{ className, orientation = 'horizontal', decorative = true, ...props },
2024-02-15 02:30:10 +00:00
ref
) => (
<SeparatorPrimitive.Root
ref={ref}
decorative={decorative}
orientation={orientation}
className={cn(
2024-02-16 01:49:19 +00:00
'shrink-0 bg-border',
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
2024-02-15 02:30:10 +00:00
className
)}
{...props}
/>
)
2024-02-16 01:49:19 +00:00
);
Separator.displayName = SeparatorPrimitive.Root.displayName;
2024-02-15 02:30:10 +00:00
2024-02-16 01:49:19 +00:00
export { Separator };