@ozen-ui/kit
Version:
React component library
19 lines (18 loc) • 1.02 kB
JavaScript
import { __assign, __rest } from "tslib";
import React from 'react';
import { useThemeProps } from '../../../../hooks/useThemeProps';
import { cn, polymorphicComponentWithRef } from '../../../../utils';
import { Divider } from '../../../Divider';
import { useSidebarContext } from '../../SidebarContext';
import { SIDEBAR_DIVIDER_DEFAULT_TAG } from './constants';
export var cnSidebarDivider = cn('SidebarDivider');
export var SidebarDivider = polymorphicComponentWithRef(function (inProps, ref) {
var props = useThemeProps({
props: inProps,
name: 'SidebarDivider',
});
var _a = props.as, as = _a === void 0 ? SIDEBAR_DIVIDER_DEFAULT_TAG : _a, className = props.className, other = __rest(props, ["as", "className"]);
var color = useSidebarContext().color;
return (React.createElement(Divider, __assign({}, other, { as: as, ref: ref, size: "s", color: "secondary", className: cnSidebarDivider({ color: color }, [className]) })));
});
SidebarDivider.displayName = 'SidebarDivider';