forked from Lilly-Protocol/lily-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.tsx
More file actions
43 lines (38 loc) · 1.26 KB
/
Copy pathindex.tsx
File metadata and controls
43 lines (38 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type { ReactNode } from "react";
export interface TimelineItem {
id: string;
date: string;
title: string;
description?: string;
}
interface TimelineProps {
items: TimelineItem[];
className?: string;
}
export function Timeline({ items, className = "" }: TimelineProps) {
if (items.length === 0) return null;
return (
<div className={`relative border-l border-[var(--color-border)] pl-8 ${className}`}>
{items.map((item, index) => (
<div key={item.id} className="relative pb-12 last:pb-0">
{/* Dot */}
<span className="absolute -left-[9px] top-1 h-4 w-4 rounded-full border-2 border-[var(--color-accent)] bg-[var(--color-background)]" />
{/* Content */}
<div className="flex flex-col gap-1">
<time className="text-xs font-medium uppercase tracking-wide text-[var(--color-muted)]">
{item.date}
</time>
<h3 className="text-lg font-semibold text-[var(--color-foreground)]">
{item.title}
</h3>
{item.description && (
<p className="text-sm leading-relaxed text-[var(--color-muted)]">
{item.description}
</p>
)}
</div>
</div>
))}
</div>
);
}