import React, { useState } from 'react'; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/dialog'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '../ui/card'; import { Button } from '../ui/button'; import { Badge } from '../ui/badge'; import { Separator } from '../ui/separator'; import { FileText, Receipt, Package, TrendingUp, Users, ArrowRight, Clock, CheckCircle, Target, X, Sparkles, Check } from 'lucide-react'; import { motion, AnimatePresence } from 'motion/react'; interface TemplateSelectionModalProps { open: boolean; onClose: () => void; onSelectTemplate: (templateId: string) => void; } const AVAILABLE_TEMPLATES = [ { id: 'claim-management', name: 'Claim Management', description: 'End-to-end dealer claim processing workflow with automatic IO generation and budget blocking', category: 'Dealer Operations', icon: Receipt, color: 'from-blue-500 to-indigo-600', estimatedTime: '5-7 days', steps: 7, features: [ 'Automatic IO confirmation', 'Budget blocking', 'Document verification', 'E-invoice generation', 'Credit note issuance' ] }, { id: 'vendor-payment', name: 'Vendor Payment', description: 'Streamlined vendor payment approval with PO validation and financial controls', category: 'Finance', icon: Package, color: 'from-green-500 to-emerald-600', estimatedTime: '3-5 days', steps: 5, features: [ 'PO matching', 'Invoice verification', 'Multi-level approvals', 'Payment scheduling' ] } ]; export function TemplateSelectionModal({ open, onClose, onSelectTemplate }: TemplateSelectionModalProps) { const [selectedTemplate, setSelectedTemplate] = useState(null); const handleSelect = (templateId: string) => { setSelectedTemplate(templateId); }; const handleContinue = () => { if (selectedTemplate) { onSelectTemplate(selectedTemplate); onClose(); } }; return ( {/* Accessibility - Hidden Title and Description */} Select a Template Choose from pre-configured templates with predefined workflows and approval chains for faster processing. {/* Custom Close button */} {/* Full Screen Content Container */}
{/* Header Section */}

Choose Your Template

Select from pre-configured templates with predefined workflows and approval chains for faster processing.

{/* Template Cards Grid */}
{AVAILABLE_TEMPLATES.map((template, index) => { const Icon = template.icon; const isSelected = selectedTemplate === template.id; return ( handleSelect(template.id)} >
{isSelected && (
)}
{template.name} {template.description}
{template.category}
{template.estimatedTime}
{template.steps} steps

Key Features:

{template.features.slice(0, 3).map((feature, idx) => (
{feature}
))} {template.features.length > 3 && (

+{template.features.length - 3} more features

)}
); })}
{/* Action Buttons */} {/* Selected template indicator */} {selectedTemplate && (

Selected: {AVAILABLE_TEMPLATES.find(t => t.id === selectedTemplate)?.name}

)}
); }