import React from 'react'; import type { LucideIcon } from 'lucide-react'; import { Badge } from '@/components/ui/badge'; import { CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card'; import { Progress } from '@/components/ui/progress'; import { FrostedCard } from './frosted-surface'; import { ChecklistRow } from './checklist-row'; export type ChecklistStep = { key: string; title: string; description: string; done: boolean; ctaLabel?: string | null; onAction?: () => void; icon: LucideIcon; }; type TenantOnboardingChecklistCardProps = { title: string; description?: string; steps: ChecklistStep[]; completedLabel: string; pendingLabel: string; completionPercent: number; completedCount: number; totalCount: number; emptyCopy?: string; fallbackActionLabel?: string; }; export function TenantOnboardingChecklistCard({ title, description, steps, completedLabel, pendingLabel, completionPercent, completedCount, totalCount, emptyCopy, fallbackActionLabel, }: TenantOnboardingChecklistCardProps) { return (
{title} {description ? {description} : null}
{completionPercent}% ยท {completedCount}/{totalCount}
{steps.map((step) => { const Icon = step.icon; return ( } label={step.title} hint={step.description} completed={step.done} status={{ complete: completedLabel, pending: pendingLabel }} action={ step.done || (!step.ctaLabel && !fallbackActionLabel) ? undefined : { label: step.ctaLabel ?? fallbackActionLabel ?? '', onClick: () => step.onAction?.(), disabled: !step.onAction, } } /> ); })}
{steps.length === 0 && emptyCopy ? (

{emptyCopy}

) : null}
); }