import { ReactNode } from "react";
import { Link } from "react-router";
import { CheckCircleIcon, TimeIcon, ArrowRightIcon } from "../../icons";
import { Tooltip } from "../ui/tooltip";
export interface WorkflowStep {
number: number;
title: string;
status: "completed" | "in_progress" | "pending";
count: number;
path: string;
description?: string;
details?: string; // Additional details for tooltip
}
interface WorkflowPipelineProps {
steps: WorkflowStep[];
onStepClick?: (step: WorkflowStep) => void;
showConnections?: boolean;
className?: string;
}
export default function WorkflowPipeline({
steps,
onStepClick,
showConnections = true,
className = "",
}: WorkflowPipelineProps) {
const getStatusColor = (status: WorkflowStep["status"]) => {
switch (status) {
case "completed":
return "bg-success-500 border-success-500 text-white";
case "in_progress":
return "bg-warning-500 border-warning-500 text-white";
case "pending":
return "bg-gray-200 border-gray-300 text-gray-600 dark:bg-gray-700 dark:border-gray-600 dark:text-gray-400";
}
};
const getStatusIcon = (status: WorkflowStep["status"], stepNumber: number) => {
switch (status) {
case "completed":
return
{step.title}
{step.count > 0 ? ( <> {step.count} {step.title.toLowerCase().includes('keyword') ? 'keywords' : step.title.toLowerCase().includes('cluster') ? 'clusters' : step.title.toLowerCase().includes('idea') ? 'ideas' : step.title.toLowerCase().includes('task') ? 'tasks' : 'items'} > ) : ( No items )}
{step.status === "pending" && step.count === 0 && ( { if (onStepClick) { e.preventDefault(); onStepClick(step); } }} > Start Now