mirror of
https://github.com/bitbaum/botsmann.git
synced 2026-12-04 04:47:45 +01:00
Refactored multiple API routes and components to improve code organization and reduce duplication: - Simplified API route implementations across chat, documents, consultations, and other endpoints - Reorganized navigation components for better maintainability - Added shared utility functions and hooks - Created reusable Avatar and Logo components - Added validation schemas and API utilities - Improved type definitions and constants management Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
74 lines
2.4 KiB
TypeScript
74 lines
2.4 KiB
TypeScript
'use client';
|
|
|
|
/**
|
|
* Step indicator for wizard progress
|
|
*/
|
|
|
|
interface StepIndicatorProps {
|
|
currentStep: number;
|
|
totalSteps: number;
|
|
steps: { label: string; description?: string }[];
|
|
}
|
|
|
|
export function StepIndicator({ currentStep, totalSteps, steps }: StepIndicatorProps) {
|
|
return (
|
|
<nav aria-label="Progress" className="mb-8">
|
|
<ol className="flex items-center justify-between">
|
|
{steps.map((step, index) => {
|
|
const stepNumber = index + 1;
|
|
const isCompleted = stepNumber < currentStep;
|
|
const isCurrent = stepNumber === currentStep;
|
|
|
|
return (
|
|
<li key={step.label} className="relative flex-1">
|
|
{/* Connector line */}
|
|
{index < totalSteps - 1 && (
|
|
<div
|
|
className={`absolute top-4 left-1/2 w-full h-0.5 ${
|
|
isCompleted ? 'bg-blue-600' : 'bg-gray-200'
|
|
}`}
|
|
aria-hidden="true"
|
|
/>
|
|
)}
|
|
|
|
<div className="relative flex flex-col items-center group">
|
|
{/* Step circle */}
|
|
<span
|
|
className={`flex items-center justify-center w-8 h-8 rounded-full text-sm font-medium transition-colors ${
|
|
isCompleted
|
|
? 'bg-blue-600 text-white'
|
|
: isCurrent
|
|
? 'bg-blue-600 text-white ring-4 ring-blue-100'
|
|
: 'bg-gray-200 text-gray-500'
|
|
}`}
|
|
>
|
|
{isCompleted ? (
|
|
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
|
|
<path
|
|
fillRule="evenodd"
|
|
d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
|
|
clipRule="evenodd"
|
|
/>
|
|
</svg>
|
|
) : (
|
|
stepNumber
|
|
)}
|
|
</span>
|
|
|
|
{/* Step label */}
|
|
<span
|
|
className={`mt-2 text-xs font-medium ${
|
|
isCurrent ? 'text-blue-600' : 'text-gray-500'
|
|
}`}
|
|
>
|
|
{step.label}
|
|
</span>
|
|
</div>
|
|
</li>
|
|
);
|
|
})}
|
|
</ol>
|
|
</nav>
|
|
);
|
|
}
|