@vertisanpro/flowbite-react
Version:
Non-Official React components built for Flowbite and Tailwind CSS
13 lines (12 loc) • 770 B
JavaScript
'use client';
import { twMerge } from '@vertisanpro/tailwind-merge';
import React from 'react';
import { mergeDeep } from '../../helpers/merge-deep';
import { useTimelineContext } from './TimelineContext';
import { TimelineItemContext } from './TimelineItemContext';
export const TimelineItem = ({ children, className, theme: customTheme = {}, ...props }) => {
const { theme: rootTheme, horizontal } = useTimelineContext();
const theme = mergeDeep(rootTheme.item, customTheme);
return (React.createElement(TimelineItemContext.Provider, { value: { theme } },
React.createElement("li", { "data-testid": "timeline-item", className: twMerge(horizontal && theme.root.horizontal, !horizontal && theme.root.vertical, className), ...props }, children)));
};