// File: components/custom/workflow-visualizer.tsx import React from "react"; import { Check, Clock, XCircle, AlertCircle } from "lucide-react"; import { cn } from "@/lib/utils"; /** * สถานะของขั้นตอนใน Workflow */ export type StepStatus = "completed" | "current" | "pending" | "rejected" | "skipped"; export interface WorkflowStep { id: string | number; label: string; subLabel?: string; // เช่น ชื่อองค์กร หรือ ชื่อผู้อนุมัติ status: StepStatus; date?: string; // วันที่ดำเนินการ (ถ้ามี) } interface WorkflowVisualizerProps { steps: WorkflowStep[]; className?: string; } /** * WorkflowVisualizer Component * แสดงเส้นเวลา (Timeline) ของกระบวนการอนุมัติแบบแนวนอน */ export function WorkflowVisualizer({ steps, className }: WorkflowVisualizerProps) { return (
{step.label}
{step.subLabel && ({step.subLabel}
)} {step.date && ({step.date}
)}