forked from StellarSplit/StellarSplit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseparator.tsx
More file actions
35 lines (32 loc) · 807 Bytes
/
Copy pathseparator.tsx
File metadata and controls
35 lines (32 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from "react";
import { cn } from "@utils/format";
export interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
orientation?: "horizontal" | "vertical";
decorative?: boolean;
}
export const Separator = React.forwardRef<HTMLDivElement, SeparatorProps>(
(
{
className,
orientation = "horizontal",
decorative = true,
...props
},
ref
) => {
return (
<div
ref={ref}
role={decorative ? "none" : "separator"}
aria-orientation={decorative ? undefined : orientation}
className={cn(
"shrink-0 bg-zinc-800",
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
className
)}
{...props}
/>
);
}
);
Separator.displayName = "Separator";