tahamajs/IE / Projects /front /src /components /genui /TimelineComponent.tsx
tahamajs's picture
download
raw
1.7 kB
import { Clock, MapPin, Users } from "lucide-react";
interface TimelineEvent {
id: string;
title: string;
date: string;
description: string;
location?: string;
attendees?: string[];
}
interface TimelineComponentProps {
events?: TimelineEvent[];
}
const DEFAULT_EVENTS: TimelineEvent[] = [
{ id: "1", title: "Project kickoff", date: "2025-01-15", description: "Initial team meeting", location: "Conference room A" },
{ id: "2", title: "Literature review", date: "2025-02-01", description: "Complete literature search" },
{ id: "3", title: "First draft", date: "2025-03-10", description: "Submit manuscript draft" },
];
export function TimelineComponent({ events = DEFAULT_EVENTS }: TimelineComponentProps) {
return (
<div className="space-y-4">
{events.map((event, idx) => (
<div key={event.id} className="relative pl-6 pb-6 border-l-2 border-primary last:border-0">
<div className="absolute left-0 top-1 -translate-x-1/2 w-3 h-3 rounded-full bg-primary" />
<div className="mb-1 flex flex-wrap items-center gap-2 text-xs text-gray-500">
<Clock className="w-3 h-3" /> {new Date(event.date).toLocaleDateString()}
{event.location && <><MapPin className="w-3 h-3 ml-2" /> {event.location}</>}
</div>
<h4 className="font-semibold text-sm">{event.title}</h4>
<p className="text-xs text-gray-500 mt-1">{event.description}</p>
{event.attendees && (
<div className="flex items-center gap-1 mt-2 text-xs text-gray-400">
<Users className="w-3 h-3" /> {event.attendees.join(", ")}
</div>
)}
</div>
))}
</div>
);
}

Xet Storage Details

Size:
1.7 kB
·
Xet hash:
6d504f368887d164612b074d01994e39ab99731417d23a0a2b5be6e57a949215

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.