Files
yaak-mountain-loop/src-web/components/core/Separator.tsx
Gregory Schier c9b4e6181c Use new theme vars (#63)
This PR swaps the theme to use the new stuff from the Theme Studio
2024-08-13 07:44:28 -07:00

28 lines
803 B
TypeScript

import classNames from 'classnames';
import type { ReactNode } from 'react';
interface Props {
orientation?: 'horizontal' | 'vertical';
dashed?: boolean;
className?: string;
children?: ReactNode;
}
export function Separator({ className, dashed, orientation = 'horizontal', children }: Props) {
return (
<div role="separator" className={classNames(className, 'flex items-center')}>
{children && (
<div className="text-sm text-text-subtlest mr-2 whitespace-nowrap">{children}</div>
)}
<div
className={classNames(
'h-0 border-t border-t-border-subtle',
dashed && 'border-dashed',
orientation === 'horizontal' && 'w-full h-[1px]',
orientation === 'vertical' && 'h-full w-[1px]',
)}
/>
</div>
);
}