import React, { useState } from 'react'; import { View, ScrollView, Text, StyleSheet, Pressable } from 'react-native'; import { Ux4gJourneyTimeline, Ux4gJourneyStep, } from '../components/journey-timeline'; import { useUx4gTheme } from '../theme/Ux4gThemeContext'; import { Ux4gIcons } from '../foundation/icons'; export const JourneyTimelineShowcase: React.FC = () => { const theme = useUx4gTheme(); const [currentStep, setCurrentStep] = useState(1); const applicationJourneySteps: Ux4gJourneyStep[] = [ { date: '05 Apr 2026', tag: 'COMPLETED', title: 'Application Submitted', helpingText: 'Reference ID: #APP-948210-IN', status: { text: 'Verified by Citizen Portal', badgeText: 'Success', badgePosition: 'bottom', }, }, { date: '08 Apr 2026', tag: 'IN PROGRESS', title: 'Document Verification', helpingText: 'Aadhaar & PAN card verification under review.', status: { text: '2 days remaining', badgeText: 'Pending', badgePosition: 'bottom', }, }, { date: '12 Apr 2026', tag: 'UPCOMING', title: 'Field Inspection', helpingText: 'Scheduled physical premises verification.', }, { date: '18 Apr 2026', tag: 'UPCOMING', title: 'Final Approval & Issuance', helpingText: 'Digital Certificate generation.', }, ]; return ( {/* Card 1: Vertical Journey Timeline with Header & Status Badges */} Journey Timeline — Vertical Application Flow Sequential timeline with header, dates, tags, status pills, and line connections. Ported directly from Flutter `journey_timeline.dart`. {/* Step Nav Controls */} Interactive Timeline Navigation (Active Step: {currentStep + 1} of {applicationJourneySteps.length}) setCurrentStep((s) => Math.max(0, s - 1))} disabled={currentStep <= 0} style={[ styles.navButton, { backgroundColor: currentStep > 0 ? theme.colors.primary : `${theme.colors.onSurface}26`, flex: 1, marginRight: 6, }, ]} > Previous Step setCurrentStep((s) => Math.min(applicationJourneySteps.length - 1, s + 1)) } disabled={currentStep >= applicationJourneySteps.length - 1} style={[ styles.navButton, { backgroundColor: currentStep < applicationJourneySteps.length - 1 ? theme.colors.primary : `${theme.colors.onSurface}26`, flex: 1, marginLeft: 6, }, ]} > Next Step {/* Card 2: Timeline Card Variants (Widgetbook Variant) */} Timeline Card Variants Demonstrates different step card features including helping text, external link icons, and status badges. Ported directly from Flutter Widgetbook `data_stories.dart`. {/* Card 3: Vertical Timeline with Header (Widgetbook Variant) */} Vertical Timeline with Header A vertical timeline with header section, compact date + tag cards, and trailing settings icon. Ported from Flutter Widgetbook `data_stories.dart`. {/* Card 3: Horizontal Timeline with Header (Widgetbook Variant) */} Horizontal Timeline with Header Horizontal layout with header section, 6-step progress indicator line, and active step card detail. Ported from Flutter Widgetbook `data_stories.dart`. ); }; const styles = StyleSheet.create({ container: { flex: 1, }, content: { padding: 16, }, card: { borderWidth: 1, borderRadius: 12, padding: 16, marginBottom: 20, }, cardTitle: { fontSize: 20, fontWeight: 'bold', marginBottom: 6, }, cardSubtitle: { fontSize: 13, lineHeight: 18, }, sectionTitle: { fontSize: 14, fontWeight: 'bold', }, navButton: { paddingVertical: 10, borderRadius: 8, alignItems: 'center', justifyContent: 'center', }, navButtonText: { color: '#FFFFFF', fontWeight: 'bold', fontSize: 13, }, });