import type { ComponentProps, ParentComponent } from 'solid-js'; import { type Component, For, type JSXElement, Show, mergeProps, splitProps, } from 'solid-js'; import { cn } from '~/utils/styles'; export type TimelinePropsItem = Omit< TimelineItemProps, 'isActive' | 'isActiveBullet' | 'bulletSize' | 'lineSize' > & { bulletSize?: number; }; export type TimelineProps = { items: TimelinePropsItem[]; activeItem: number; bulletSize?: number; lineSize?: number; }; /* No bullet or line is active when activeItem is -1 First bullet is active only if activeItem is 0 or more First line is active only if activeItem is 1 or more */ const Timeline: Component = (rawProps) => { const props = mergeProps({ bulletSize: 16, lineSize: 2 }, rawProps); return ( ); }; export type TimelineItemProps = { title: JSXElement; description?: JSXElement; bullet?: JSXElement; isLast?: boolean; isActive: boolean; isActiveBullet: boolean; class?: string; bulletSize: number; lineSize: number; }; const TimelineItem: Component = (props) => { const [local, others] = splitProps(props, [ 'class', 'bullet', 'description', 'title', 'isLast', 'isActive', 'isActiveBullet', 'bulletSize', 'lineSize', ]); return (
  • {local.bullet} {local.title} {local.description}
  • ); }; export type TimelineItemBulletProps = { children?: JSXElement; isActive?: boolean; bulletSize: number; lineSize: number; }; const TimelineItemBullet: Component = (props) => { return ( ); }; const TimelineItemTitle: ParentComponent = (props) => { return (
    {props.children}
    ); }; const TimelineItemDescription: Component> = (props) => { const [local, others] = splitProps(props, ['class', 'children']); return (

    {local.children}

    ); }; export { Timeline };