mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
33 lines
707 B
TypeScript
33 lines
707 B
TypeScript
import clsx from 'clsx';
|
|
|
|
import { CProps } from '@/components/props';
|
|
|
|
export interface DividerProps extends CProps.Styling {
|
|
/** Indicates whether the divider is vertical. */
|
|
vertical?: boolean;
|
|
|
|
/** Margins to apply to the divider `classNames`. */
|
|
margins?: string;
|
|
}
|
|
|
|
/**
|
|
* Horizontal or vertical divider with customizable margins and styling.
|
|
*/
|
|
function Divider({ vertical, margins = 'mx-2', className, ...restProps }: DividerProps) {
|
|
return (
|
|
<div
|
|
className={clsx(
|
|
margins, //prettier: split-lines
|
|
className,
|
|
{
|
|
'border-x': vertical,
|
|
'border-y': !vertical
|
|
}
|
|
)}
|
|
{...restProps}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default Divider;
|