import classNames from "classnames"; import React from "react"; interface Props { children?: | string | React.ReactElement | React.ReactElement[] | React.ReactNode; childrenAlign?: "start" | "center" | "end"; childrenGap?: number; color?: string; indent?: number; endIndent?: number; thickness?: number; orientation?: "vertical" | "horizontal"; } const Divider = ({ children, childrenAlign = "center", color, indent, endIndent, thickness, childrenGap, orientation = "horizontal", }: Props) => { const line = (
); let row; if (children) { row = (
{childrenAlign == "start" && ( <> {children} {line} )} {childrenAlign == "center" && ( <> {line} {children} {line} )} {childrenAlign == "end" && ( <> {line} {children} )}
); } else { row = line; } return (
{row}
); }; export default Divider;