From fcc2f4704e39b0e69b377cc138f75027721dac22 Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Tue, 22 Jul 2025 15:08:37 +0300 Subject: Initial template --- src/components/ui/Timeline.astro | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/components/ui/Timeline.astro (limited to 'src/components/ui/Timeline.astro') diff --git a/src/components/ui/Timeline.astro b/src/components/ui/Timeline.astro new file mode 100644 index 0000000..b25c9de --- /dev/null +++ b/src/components/ui/Timeline.astro @@ -0,0 +1,60 @@ +--- +import { Icon } from 'astro-icon/components'; +import { twMerge } from 'tailwind-merge'; +import type { Item } from '~/types'; + +export interface Props { + items?: Array; + defaultIcon?: string; + classes?: Record; +} + +const { items = [], classes = {}, defaultIcon } = Astro.props as Props; + +const { + container: containerClass = '', + panel: panelClass = '', + title: titleClass = '', + description: descriptionClass = '', + icon: defaultIconClass = 'text-primary dark:text-slate-200 border-primary dark:border-secondary', +} = classes; +--- + +{ + items && items.length > 0 && ( +
+ {items.map(({ title, description, icon, classes: itemClasses = {} }, index = 0) => ( +
+
+
+
+ {(icon || defaultIcon) && ( + + )} +
+
+ {index !== items.length - 1 &&
} +
+
+ {title &&

} + {description && ( +

+ )} +

+
+ ))} +
+ ) +} -- cgit v1.2.3