import { memo } from 'react'; import { cn } from '@/lib/utils'; import { Button } from '@/components/ui/button'; import { Kbd } from '@/components/ui/kbd'; import { formatShortcut } from '@/store/app-store'; import { getEmptyStateConfig, type EmptyStateConfig } from '../constants'; import { Lightbulb, Play, Clock, CheckCircle2, Sparkles, Wand2 } from 'lucide-react'; const ICON_MAP = { lightbulb: Lightbulb, play: Play, clock: Clock, check: CheckCircle2, sparkles: Sparkles, } as const; interface EmptyStateCardProps { columnId: string; columnTitle?: string; /** Keyboard shortcut for adding features (from settings) */ addFeatureShortcut?: string; /** Whether the column is empty due to active filters */ isFilteredEmpty?: boolean; /** Whether we're in read-only mode (hide actions) */ isReadOnly?: boolean; /** Called when user clicks "Use AI Suggestions" */ onAiSuggest?: () => void; /** Card opacity (matches board settings) */ opacity?: number; /** Enable glassmorphism effect */ glassmorphism?: boolean; /** Custom config override for pipeline steps */ customConfig?: Partial; } export const EmptyStateCard = memo(function EmptyStateCard({ columnId, addFeatureShortcut, isFilteredEmpty = false, isReadOnly = false, onAiSuggest, customConfig, }: EmptyStateCardProps) { // Get base config and merge with custom overrides const baseConfig = getEmptyStateConfig(columnId); const config: EmptyStateConfig = { ...baseConfig, ...customConfig }; const IconComponent = ICON_MAP[config.icon]; const showActions = !isReadOnly && !isFilteredEmpty; const showShortcut = columnId === 'backlog' && addFeatureShortcut && showActions; // Action button handler const handlePrimaryAction = () => { if (!config.primaryAction) return; if (config.primaryAction.actionType === 'ai-suggest') { onAiSuggest?.(); } }; return (
{/* Icon */}
{/* Title */}

{isFilteredEmpty ? 'No Matching Items' : config.title}

{/* Description */}

{isFilteredEmpty ? 'No features match your current filters.' : config.description}

{/* Keyboard shortcut hint for backlog */} {showShortcut && (
Press {formatShortcut(addFeatureShortcut, true)} to add
)} {/* AI Suggest action for backlog */} {showActions && config.primaryAction && config.primaryAction.actionType === 'ai-suggest' && ( )} {/* Filtered empty state hint */} {isFilteredEmpty && (

Clear filters to see all items

)}
); });