mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-17 03:19:59 +03:00
2f68b445db
Issue https://github.com/StanGirard/quivr/issues/1908 Demo: https://github.com/StanGirard/quivr/assets/63923024/3be5d58c-4052-4c06-8434-920d4db0365e
52 lines
1.1 KiB
TypeScript
52 lines
1.1 KiB
TypeScript
/* eslint-disable */
|
|
import { forwardRef, HTMLAttributes, LegacyRef } from "react";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
|
|
type DividerProps = HTMLAttributes<HTMLDivElement> & {
|
|
text?: string;
|
|
textClassName?: string;
|
|
separatorClassName?: string;
|
|
};
|
|
|
|
const Divider = forwardRef(
|
|
(
|
|
{
|
|
className,
|
|
separatorClassName,
|
|
textClassName,
|
|
text,
|
|
...props
|
|
}: DividerProps,
|
|
ref
|
|
): JSX.Element => {
|
|
return (
|
|
<div
|
|
ref={ref as LegacyRef<HTMLDivElement>}
|
|
className={cn("flex items-center justify-center", className)}
|
|
{...props}
|
|
>
|
|
<hr
|
|
className={cn("border-t border-gray-300 w-12", separatorClassName)}
|
|
/>
|
|
{text !== undefined && (
|
|
<p
|
|
className={cn(
|
|
"px-3 text-center text-gray-500 dark:text-white",
|
|
textClassName
|
|
)}
|
|
>
|
|
{text}
|
|
</p>
|
|
)}
|
|
<hr
|
|
className={cn("border-t border-gray-300 w-12", separatorClassName)}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
);
|
|
Divider.displayName = "AnimatedCard";
|
|
|
|
export { Divider };
|