@kubit-ui-web/react-components
Version:
Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience
28 lines • 1.21 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { Divider } from '../../divider/divider';
import { LineSeparator } from '../../lineSeparator/lineSeparator';
/**
* @description
* ListDivider component is used to display a divider between lists.
* It can be a string or a Divider component.
* If it is a string, it will be rendered as a LineSeparator component.
* If it is a Divider component, it will be rendered as a Divider component.
* If it is null, it will not be rendered.
* @example
* <ListDivider dividerValue="test" />
* <ListDivider dividerValue={<Divider variant="dashed" />} />
*/
export const ListDivider = (props) => {
if (!props.divider) {
return null;
}
if (typeof props.divider === 'string') {
return (_jsx(LineSeparator, { label: { content: props.divider }, labelVariant: props.dividerStyles?.lineSeparatorLabelVariant, lineVariant: props.dividerStyles?.lineSeparatorLineVariant }));
}
const dividerVariant = props.divider.variant ?? props.dividerStyles?.dividerVariant;
if (!dividerVariant) {
return null;
}
return _jsx(Divider, { ...props.divider, variant: dividerVariant });
};
//# sourceMappingURL=listDivider.js.map