@digilogiclabs/create-saas-app 1.17.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +153 -12
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cli/commands/create.d.ts.map +1 -1
  5. package/dist/cli/commands/create.js +6 -2
  6. package/dist/cli/commands/create.js.map +1 -1
  7. package/dist/cli/index.js +1 -1
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/cli/prompts/project-setup.d.ts.map +1 -1
  10. package/dist/cli/prompts/project-setup.js +4 -0
  11. package/dist/cli/prompts/project-setup.js.map +1 -1
  12. package/dist/generators/template-generator.d.ts.map +1 -1
  13. package/dist/generators/template-generator.js +13 -7
  14. package/dist/generators/template-generator.js.map +1 -1
  15. package/dist/templates/mobile/base/template/App.tsx +2 -0
  16. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +85 -4
  17. package/dist/templates/mobile/ui-auth-payments/template/app/_layout.tsx +2 -0
  18. package/dist/templates/mobile/ui-auth-payments-ai/template/.env.example +23 -0
  19. package/dist/templates/mobile/ui-auth-payments-ai/template/README.md +254 -0
  20. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/_layout.tsx +169 -0
  21. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/ai.tsx +522 -0
  22. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/analytics.tsx +668 -0
  23. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/billing.tsx +743 -0
  24. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/index.tsx +676 -0
  25. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/orders.tsx +402 -0
  26. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/profile.tsx +580 -0
  27. package/dist/templates/mobile/ui-auth-payments-ai/template/app/_layout.tsx +127 -0
  28. package/dist/templates/mobile/ui-auth-payments-ai/template/app/auth/login.tsx +246 -0
  29. package/dist/templates/mobile/ui-auth-payments-ai/template/app/auth/signup.tsx +362 -0
  30. package/dist/templates/mobile/ui-auth-payments-ai/template/app/onboarding/index.tsx +193 -0
  31. package/dist/templates/mobile/ui-auth-payments-ai/template/app/tour/index.tsx +272 -0
  32. package/dist/templates/mobile/ui-auth-payments-ai/template/app.json +93 -0
  33. package/dist/templates/mobile/ui-auth-payments-ai/template/babel.config.js +23 -0
  34. package/dist/templates/mobile/ui-auth-payments-ai/template/eas.json +45 -0
  35. package/dist/templates/mobile/ui-auth-payments-ai/template/expo-env.d.ts +3 -0
  36. package/dist/templates/mobile/ui-auth-payments-ai/template/jest-setup.ts +74 -0
  37. package/dist/templates/mobile/ui-auth-payments-ai/template/metro.config.js +11 -0
  38. package/dist/templates/mobile/ui-auth-payments-ai/template/package.json +108 -0
  39. package/dist/templates/mobile/ui-auth-payments-ai/template/tsconfig.json +31 -0
  40. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/README.md +655 -0
  41. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +683 -0
  42. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +787 -0
  43. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +346 -0
  44. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +180 -0
  45. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/package.json +113 -0
  46. package/dist/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +599 -0
  47. package/dist/templates/web/base/template/src/app/loading.tsx +45 -27
  48. package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +2 -0
  49. package/dist/templates/web/ui-auth/template/src/app/loading.tsx +30 -12
  50. package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +2 -0
  51. package/dist/templates/web/ui-auth/template/src/components/shared/header.tsx +43 -2
  52. package/dist/templates/web/ui-auth-ai/template/package.json +1 -1
  53. package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +2 -0
  54. package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +2 -0
  55. package/dist/templates/web/ui-auth-payments-ai-rag/template/README.md +434 -0
  56. package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +642 -0
  57. package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +466 -0
  58. package/dist/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +393 -0
  59. package/dist/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +457 -0
  60. package/dist/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +478 -0
  61. package/dist/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +250 -0
  62. package/dist/templates/web/ui-auth-payments-ai-rag/template/package.json +74 -0
  63. package/dist/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +622 -0
  64. package/dist/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +396 -0
  65. package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +2 -0
  66. package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +2 -0
  67. package/package.json +1 -1
  68. package/src/templates/mobile/base/template/App.tsx +2 -0
  69. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +85 -4
  70. package/src/templates/mobile/ui-auth-payments/template/app/_layout.tsx +2 -0
  71. package/src/templates/mobile/ui-auth-payments-ai/template/.env.example +23 -0
  72. package/src/templates/mobile/ui-auth-payments-ai/template/README.md +254 -0
  73. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/_layout.tsx +169 -0
  74. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/ai.tsx +522 -0
  75. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/analytics.tsx +668 -0
  76. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/billing.tsx +743 -0
  77. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/index.tsx +676 -0
  78. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/orders.tsx +402 -0
  79. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/profile.tsx +580 -0
  80. package/src/templates/mobile/ui-auth-payments-ai/template/app/_layout.tsx +127 -0
  81. package/src/templates/mobile/ui-auth-payments-ai/template/app/auth/login.tsx +246 -0
  82. package/src/templates/mobile/ui-auth-payments-ai/template/app/auth/signup.tsx +362 -0
  83. package/src/templates/mobile/ui-auth-payments-ai/template/app/onboarding/index.tsx +193 -0
  84. package/src/templates/mobile/ui-auth-payments-ai/template/app/tour/index.tsx +272 -0
  85. package/src/templates/mobile/ui-auth-payments-ai/template/app.json +93 -0
  86. package/src/templates/mobile/ui-auth-payments-ai/template/babel.config.js +23 -0
  87. package/src/templates/mobile/ui-auth-payments-ai/template/eas.json +45 -0
  88. package/src/templates/mobile/ui-auth-payments-ai/template/expo-env.d.ts +3 -0
  89. package/src/templates/mobile/ui-auth-payments-ai/template/jest-setup.ts +74 -0
  90. package/src/templates/mobile/ui-auth-payments-ai/template/metro.config.js +11 -0
  91. package/src/templates/mobile/ui-auth-payments-ai/template/package.json +108 -0
  92. package/src/templates/mobile/ui-auth-payments-ai/template/tsconfig.json +31 -0
  93. package/src/templates/mobile/ui-auth-payments-ai-rag/template/README.md +655 -0
  94. package/src/templates/mobile/ui-auth-payments-ai-rag/template/app/(tabs)/ai.tsx +683 -0
  95. package/src/templates/mobile/ui-auth-payments-ai-rag/template/docs/MOBILE-SETUP.md +787 -0
  96. package/src/templates/mobile/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +346 -0
  97. package/src/templates/mobile/ui-auth-payments-ai-rag/template/lib/rag/config.ts +180 -0
  98. package/src/templates/mobile/ui-auth-payments-ai-rag/template/package.json +113 -0
  99. package/src/templates/mobile/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +599 -0
  100. package/src/templates/web/base/template/src/app/loading.tsx +45 -27
  101. package/src/templates/web/base/template/src/components/providers/app-providers.tsx +2 -0
  102. package/src/templates/web/ui-auth/template/src/app/loading.tsx +30 -12
  103. package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +2 -0
  104. package/src/templates/web/ui-auth/template/src/components/shared/header.tsx +43 -2
  105. package/src/templates/web/ui-auth-ai/template/package.json +1 -1
  106. package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +2 -0
  107. package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +2 -0
  108. package/src/templates/web/ui-auth-payments-ai-rag/template/README.md +434 -0
  109. package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/KnowledgeManager.tsx +642 -0
  110. package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGAnalytics.tsx +466 -0
  111. package/src/templates/web/ui-auth-payments-ai-rag/template/components/rag/RAGChatInterface.tsx +393 -0
  112. package/src/templates/web/ui-auth-payments-ai-rag/template/docs/GETTING-STARTED.md +457 -0
  113. package/src/templates/web/ui-auth-payments-ai-rag/template/hooks/useRAGSystem.ts +478 -0
  114. package/src/templates/web/ui-auth-payments-ai-rag/template/lib/rag/config.ts +250 -0
  115. package/src/templates/web/ui-auth-payments-ai-rag/template/package.json +74 -0
  116. package/src/templates/web/ui-auth-payments-ai-rag/template/scripts/setup-rag.js +622 -0
  117. package/src/templates/web/ui-auth-payments-ai-rag/template/src/app/ai/page.tsx +396 -0
  118. package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +2 -0
  119. package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +2 -0
@@ -0,0 +1,169 @@
1
+ import React from 'react';
2
+ import { View } from 'react-native';
3
+ import { Tabs } from 'expo-router';
4
+ import { useAuth } from '@digilogiclabs/saas-factory-auth/native';
5
+ import { Redirect } from 'expo-router';
6
+
7
+ // UI Components - Updated for v0.22.0
8
+ import {
9
+ BottomTabBar,
10
+ PageTransition,
11
+ useTheme
12
+ } from '@digilogiclabs/saas-factory-ui/native';
13
+
14
+ // Icons
15
+ import {
16
+ Home,
17
+ User,
18
+ Settings,
19
+ CreditCard,
20
+ BarChart3,
21
+ ShoppingBag,
22
+ Sparkles
23
+ } from 'react-native-heroicons/outline';
24
+ import {
25
+ Home as HomeSolid,
26
+ User as UserSolid,
27
+ Settings as SettingsSolid,
28
+ CreditCard as CreditCardSolid,
29
+ BarChart3 as BarChart3Solid,
30
+ ShoppingBag as ShoppingBagSolid,
31
+ Sparkles as SparklesSolid
32
+ } from 'react-native-heroicons/solid';
33
+
34
+ // Tab configuration for BottomTabBar
35
+ const tabConfig = [
36
+ {
37
+ id: 'index',
38
+ label: 'Home',
39
+ icon: Home,
40
+ activeIcon: HomeSolid,
41
+ route: '/dashboard'
42
+ },
43
+ {
44
+ id: 'ai',
45
+ label: 'AI Studio',
46
+ icon: Sparkles,
47
+ activeIcon: SparklesSolid,
48
+ route: '/ai',
49
+ badge: 'NEW'
50
+ },
51
+ {
52
+ id: 'orders',
53
+ label: 'Orders',
54
+ icon: ShoppingBag,
55
+ activeIcon: ShoppingBagSolid,
56
+ route: '/orders'
57
+ },
58
+ {
59
+ id: 'analytics',
60
+ label: 'Analytics',
61
+ icon: BarChart3,
62
+ activeIcon: BarChart3Solid,
63
+ route: '/analytics'
64
+ },
65
+ {
66
+ id: 'billing',
67
+ label: 'Billing',
68
+ icon: CreditCard,
69
+ activeIcon: CreditCardSolid,
70
+ route: '/billing'
71
+ },
72
+ {
73
+ id: 'profile',
74
+ label: 'Profile',
75
+ icon: User,
76
+ activeIcon: UserSolid,
77
+ route: '/profile'
78
+ }
79
+ ];
80
+
81
+ export default function TabLayout() {
82
+ const { user, loading } = useAuth();
83
+ const { colors } = useTheme();
84
+
85
+ // Show loading state while checking authentication
86
+ if (loading) {
87
+ return null; // or a loading component
88
+ }
89
+
90
+ // Redirect to auth if user is not authenticated
91
+ if (!user) {
92
+ return <Redirect href="/auth/login" />;
93
+ }
94
+
95
+ return (
96
+ <PageTransition type="slide" direction="horizontal">
97
+ <View style={{ flex: 1 }}>
98
+ <Tabs
99
+ screenOptions={{
100
+ headerShown: false,
101
+ tabBarStyle: { display: 'none' } // Hide default tab bar since we use BottomTabBar
102
+ }}
103
+ >
104
+ <Tabs.Screen
105
+ name="index"
106
+ options={{
107
+ title: 'Dashboard',
108
+ }}
109
+ />
110
+ <Tabs.Screen
111
+ name="ai"
112
+ options={{
113
+ title: 'AI Studio',
114
+ }}
115
+ />
116
+ <Tabs.Screen
117
+ name="orders"
118
+ options={{
119
+ title: 'Orders',
120
+ }}
121
+ />
122
+ <Tabs.Screen
123
+ name="analytics"
124
+ options={{
125
+ title: 'Analytics',
126
+ }}
127
+ />
128
+ <Tabs.Screen
129
+ name="billing"
130
+ options={{
131
+ title: 'Billing',
132
+ }}
133
+ />
134
+ <Tabs.Screen
135
+ name="profile"
136
+ options={{
137
+ title: 'Profile',
138
+ }}
139
+ />
140
+ </Tabs>
141
+
142
+ {/* Enhanced BottomTabBar from v0.22.0 */}
143
+ <BottomTabBar
144
+ tabs={tabConfig}
145
+ activeTabId="index" // This should be dynamic based on current route
146
+ onTabPress={(tabId) => {
147
+ // Handle tab navigation
148
+ console.log('Tab pressed:', tabId);
149
+ }}
150
+ style={{
151
+ position: 'absolute',
152
+ bottom: 16,
153
+ left: 16,
154
+ right: 16,
155
+ borderRadius: 24,
156
+ shadowColor: '#000',
157
+ shadowOffset: { width: 0, height: 8 },
158
+ shadowOpacity: 0.12,
159
+ shadowRadius: 24,
160
+ elevation: 12,
161
+ }}
162
+ variant="floating"
163
+ showLabels={true}
164
+ hapticFeedback={true}
165
+ />
166
+ </View>
167
+ </PageTransition>
168
+ );
169
+ }
@@ -0,0 +1,522 @@
1
+ import React, { useState, useRef } from 'react';
2
+ import { View, Text, ScrollView, StyleSheet, Dimensions, Alert } from 'react-native';
3
+ import { SafeAreaView } from 'react-native-safe-area-context';
4
+ import * as Haptics from 'expo-haptics';
5
+
6
+ // UI Components - v0.22.0 with Native AI Components
7
+ import {
8
+ // AI Components
9
+ AIProvider,
10
+ AIChat,
11
+ AITextGenerator,
12
+ AIAudioGenerator,
13
+ AIVideoGenerator,
14
+ AISetupStatus,
15
+
16
+ // Native UI Components
17
+ Card,
18
+ Button,
19
+ Badge,
20
+ PageTransition,
21
+ TabbedInterface,
22
+ LazyImage,
23
+ ProgressiveImage,
24
+ NativeFeatureHighlight,
25
+ VirtualScrollList,
26
+ SwipeableCard,
27
+ useTheme,
28
+
29
+ // Layout Components
30
+ Container,
31
+ Grid,
32
+
33
+ // Icons
34
+ Sparkles,
35
+ Mic,
36
+ Video,
37
+ MessageSquare,
38
+ Zap,
39
+ Brain,
40
+ } from '@digilogiclabs/saas-factory-ui/native';
41
+
42
+ const { width } = Dimensions.get('window');
43
+
44
+ export default function AIScreen() {
45
+ const [activeTab, setActiveTab] = useState('dashboard');
46
+ const [aiStats, setAiStats] = useState({
47
+ textGenerations: 42,
48
+ audioGenerations: 18,
49
+ videoGenerations: 7,
50
+ totalTokens: 125300,
51
+ });
52
+ const { theme, isDark } = useTheme();
53
+
54
+ // AI Configuration - would normally come from environment
55
+ const aiConfig = {
56
+ providers: {
57
+ openai: {
58
+ apiKey: process.env.EXPO_PUBLIC_OPENAI_API_KEY || '',
59
+ models: {
60
+ text: 'gpt-4',
61
+ audio: 'tts-1',
62
+ }
63
+ },
64
+ elevenlabs: {
65
+ apiKey: process.env.EXPO_PUBLIC_ELEVENLABS_API_KEY || '',
66
+ },
67
+ replicate: {
68
+ apiKey: process.env.EXPO_PUBLIC_REPLICATE_API_TOKEN || '',
69
+ }
70
+ }
71
+ };
72
+
73
+ const handleTabChange = (tabId: string) => {
74
+ setActiveTab(tabId);
75
+ Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
76
+ };
77
+
78
+ const handleAIGeneration = async (type: string, result: any) => {
79
+ try {
80
+ // Update local stats
81
+ setAiStats(prev => ({
82
+ ...prev,
83
+ [`${type}Generations`]: prev[`${type}Generations` as keyof typeof prev] + 1,
84
+ totalTokens: prev.totalTokens + (result.tokens || 100)
85
+ }));
86
+
87
+ Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
88
+ Alert.alert('Success', `${type} generation completed successfully!`);
89
+ } catch (error) {
90
+ Haptics.notificationAsync(Haptics.NotificationFeedbackType.Error);
91
+ Alert.alert('Error', `${type} generation failed. Please try again.`);
92
+ }
93
+ };
94
+
95
+ const aiTabs = [
96
+ {
97
+ id: 'dashboard',
98
+ label: 'Dashboard',
99
+ icon: <Brain width={20} height={20} color={activeTab === 'dashboard' ? '#3b82f6' : '#64748b'} />,
100
+ component: renderDashboard(),
101
+ },
102
+ {
103
+ id: 'text',
104
+ label: 'Text AI',
105
+ icon: <MessageSquare width={20} height={20} color={activeTab === 'text' ? '#3b82f6' : '#64748b'} />,
106
+ component: renderTextGenerator(),
107
+ },
108
+ {
109
+ id: 'audio',
110
+ label: 'Audio AI',
111
+ icon: <Mic width={20} height={20} color={activeTab === 'audio' ? '#3b82f6' : '#64748b'} />,
112
+ component: renderAudioGenerator(),
113
+ },
114
+ {
115
+ id: 'video',
116
+ label: 'Video AI',
117
+ icon: <Video width={20} height={20} color={activeTab === 'video' ? '#3b82f6' : '#64748b'} />,
118
+ component: renderVideoGenerator(),
119
+ },
120
+ {
121
+ id: 'chat',
122
+ label: 'AI Chat',
123
+ icon: <Sparkles width={20} height={20} color={activeTab === 'chat' ? '#3b82f6' : '#64748b'} />,
124
+ component: renderAIChat(),
125
+ },
126
+ ];
127
+
128
+ function renderDashboard() {
129
+ return (
130
+ <ScrollView style={styles.tabContent} showsVerticalScrollIndicator={false}>
131
+ <Container padding={16}>
132
+ {/* AI Setup Status */}
133
+ <Card style={styles.card}>
134
+ <AISetupStatus
135
+ config={aiConfig}
136
+ onSetupComplete={() => {
137
+ Haptics.notificationAsync(Haptics.NotificationFeedbackType.Success);
138
+ }}
139
+ style={styles.setupStatus}
140
+ />
141
+ </Card>
142
+
143
+ {/* AI Stats */}
144
+ <Card style={[styles.card, styles.statsCard]}>
145
+ <Text style={[styles.cardTitle, { color: theme.colors.text }]}>
146
+ AI Usage Statistics
147
+ </Text>
148
+ <Grid columns={2} gap={12} style={styles.statsGrid}>
149
+ <View style={styles.statItem}>
150
+ <Text style={[styles.statNumber, { color: '#3b82f6' }]}>
151
+ {aiStats.textGenerations}
152
+ </Text>
153
+ <Text style={[styles.statLabel, { color: theme.colors.textMuted }]}>
154
+ Text Generations
155
+ </Text>
156
+ </View>
157
+ <View style={styles.statItem}>
158
+ <Text style={[styles.statNumber, { color: '#10b981' }]}>
159
+ {aiStats.audioGenerations}
160
+ </Text>
161
+ <Text style={[styles.statLabel, { color: theme.colors.textMuted }]}>
162
+ Audio Generations
163
+ </Text>
164
+ </View>
165
+ <View style={styles.statItem}>
166
+ <Text style={[styles.statNumber, { color: '#f59e0b' }]}>
167
+ {aiStats.videoGenerations}
168
+ </Text>
169
+ <Text style={[styles.statLabel, { color: theme.colors.textMuted }]}>
170
+ Video Generations
171
+ </Text>
172
+ </View>
173
+ <View style={styles.statItem}>
174
+ <Text style={[styles.statNumber, { color: '#8b5cf6' }]}>
175
+ {(aiStats.totalTokens / 1000).toFixed(1)}K
176
+ </Text>
177
+ <Text style={[styles.statLabel, { color: theme.colors.textMuted }]}>
178
+ Total Tokens
179
+ </Text>
180
+ </View>
181
+ </Grid>
182
+ </Card>
183
+
184
+ {/* Quick Actions */}
185
+ <Card style={styles.card}>
186
+ <Text style={[styles.cardTitle, { color: theme.colors.text }]}>
187
+ Quick Actions
188
+ </Text>
189
+ <Grid columns={2} gap={12} style={styles.quickActions}>
190
+ <Button
191
+ variant="outline"
192
+ size="lg"
193
+ onPress={() => setActiveTab('text')}
194
+ style={styles.quickActionButton}
195
+ >
196
+ <MessageSquare width={20} height={20} color="#3b82f6" />
197
+ <Text style={styles.quickActionText}>Generate Text</Text>
198
+ </Button>
199
+ <Button
200
+ variant="outline"
201
+ size="lg"
202
+ onPress={() => setActiveTab('audio')}
203
+ style={styles.quickActionButton}
204
+ >
205
+ <Mic width={20} height={20} color="#10b981" />
206
+ <Text style={styles.quickActionText}>Create Audio</Text>
207
+ </Button>
208
+ <Button
209
+ variant="outline"
210
+ size="lg"
211
+ onPress={() => setActiveTab('video')}
212
+ style={styles.quickActionButton}
213
+ >
214
+ <Video width={20} height={20} color="#f59e0b" />
215
+ <Text style={styles.quickActionText}>Make Video</Text>
216
+ </Button>
217
+ <Button
218
+ variant="outline"
219
+ size="lg"
220
+ onPress={() => setActiveTab('chat')}
221
+ style={styles.quickActionButton}
222
+ >
223
+ <Sparkles width={20} height={20} color="#8b5cf6" />
224
+ <Text style={styles.quickActionText}>AI Chat</Text>
225
+ </Button>
226
+ </Grid>
227
+ </Card>
228
+
229
+ {/* Recent Generations */}
230
+ <Card style={styles.card}>
231
+ <Text style={[styles.cardTitle, { color: theme.colors.text }]}>
232
+ Recent Generations
233
+ </Text>
234
+ <VirtualScrollList
235
+ data={[
236
+ { id: '1', type: 'text', title: 'Blog post about AI trends', time: '2 min ago', status: 'completed' },
237
+ { id: '2', type: 'audio', title: 'Podcast intro voice', time: '5 min ago', status: 'completed' },
238
+ { id: '3', type: 'video', title: 'Product demo video', time: '12 min ago', status: 'processing' },
239
+ { id: '4', type: 'text', title: 'Email marketing copy', time: '15 min ago', status: 'completed' },
240
+ ]}
241
+ renderItem={({ item }) => (
242
+ <SwipeableCard
243
+ rightActions={[
244
+ { label: 'View', color: '#3b82f6', onPress: () => console.log('View', item.id) },
245
+ { label: 'Share', color: '#10b981', onPress: () => console.log('Share', item.id) },
246
+ ]}
247
+ style={styles.recentItem}
248
+ >
249
+ <View style={styles.recentItemContent}>
250
+ <View style={styles.recentItemIcon}>
251
+ {item.type === 'text' && <MessageSquare width={16} height={16} color="#3b82f6" />}
252
+ {item.type === 'audio' && <Mic width={16} height={16} color="#10b981" />}
253
+ {item.type === 'video' && <Video width={16} height={16} color="#f59e0b" />}
254
+ </View>
255
+ <View style={styles.recentItemText}>
256
+ <Text style={[styles.recentItemTitle, { color: theme.colors.text }]}>
257
+ {item.title}
258
+ </Text>
259
+ <Text style={[styles.recentItemTime, { color: theme.colors.textMuted }]}>
260
+ {item.time}
261
+ </Text>
262
+ </View>
263
+ <Badge
264
+ variant={item.status === 'completed' ? 'success' : 'warning'}
265
+ size="sm"
266
+ >
267
+ {item.status}
268
+ </Badge>
269
+ </View>
270
+ </SwipeableCard>
271
+ )}
272
+ estimatedItemSize={80}
273
+ style={styles.recentList}
274
+ />
275
+ </Card>
276
+ </Container>
277
+ </ScrollView>
278
+ );
279
+ }
280
+
281
+ function renderTextGenerator() {
282
+ return (
283
+ <ScrollView style={styles.tabContent} showsVerticalScrollIndicator={false}>
284
+ <Container padding={16}>
285
+ <Card style={styles.card}>
286
+ <AITextGenerator
287
+ placeholder="Describe what you want to generate..."
288
+ templates={[
289
+ 'Blog post',
290
+ 'Email marketing',
291
+ 'Social media content',
292
+ 'Product description',
293
+ 'Code documentation',
294
+ 'Creative writing'
295
+ ]}
296
+ showWordCount={true}
297
+ maxLength={2000}
298
+ onGenerate={(result) => handleAIGeneration('text', result)}
299
+ style={styles.aiGenerator}
300
+ />
301
+ </Card>
302
+ </Container>
303
+ </ScrollView>
304
+ );
305
+ }
306
+
307
+ function renderAudioGenerator() {
308
+ return (
309
+ <ScrollView style={styles.tabContent} showsVerticalScrollIndicator={false}>
310
+ <Container padding={16}>
311
+ <Card style={styles.card}>
312
+ <AIAudioGenerator
313
+ placeholder="Describe the audio you want to generate..."
314
+ supportedFormats={['mp3', 'wav', 'ogg']}
315
+ showWaveform={true}
316
+ maxDuration={300}
317
+ voices={[
318
+ { id: 'alloy', name: 'Alloy', language: 'en-US' },
319
+ { id: 'echo', name: 'Echo', language: 'en-US' },
320
+ { id: 'fable', name: 'Fable', language: 'en-US' },
321
+ { id: 'onyx', name: 'Onyx', language: 'en-US' },
322
+ { id: 'nova', name: 'Nova', language: 'en-US' },
323
+ { id: 'shimmer', name: 'Shimmer', language: 'en-US' },
324
+ ]}
325
+ onGenerate={(result) => handleAIGeneration('audio', result)}
326
+ style={styles.aiGenerator}
327
+ />
328
+ </Card>
329
+ </Container>
330
+ </ScrollView>
331
+ );
332
+ }
333
+
334
+ function renderVideoGenerator() {
335
+ return (
336
+ <ScrollView style={styles.tabContent} showsVerticalScrollIndicator={false}>
337
+ <Container padding={16}>
338
+ <Card style={styles.card}>
339
+ <AIVideoGenerator
340
+ placeholder="Describe the video you want to generate..."
341
+ supportedFormats={['mp4', 'webm']}
342
+ resolution="1080p"
343
+ showPreview={true}
344
+ maxDuration={60}
345
+ styles={[
346
+ 'Photorealistic',
347
+ 'Cartoon',
348
+ 'Anime',
349
+ 'Watercolor',
350
+ 'Oil painting',
351
+ 'Digital art'
352
+ ]}
353
+ onGenerate={(result) => handleAIGeneration('video', result)}
354
+ style={styles.aiGenerator}
355
+ />
356
+ </Card>
357
+ </Container>
358
+ </ScrollView>
359
+ );
360
+ }
361
+
362
+ function renderAIChat() {
363
+ return (
364
+ <Container padding={16} style={styles.chatContainer}>
365
+ <AIChat
366
+ placeholder="Ask me anything..."
367
+ showTypingIndicator={true}
368
+ enableFileUpload={false} // Disabled for mobile for now
369
+ maxMessages={50}
370
+ onMessage={(message) => console.log('Chat message:', message)}
371
+ style={styles.aiChat}
372
+ />
373
+ </Container>
374
+ );
375
+ }
376
+
377
+ return (
378
+ <AIProvider config={aiConfig}>
379
+ <PageTransition type="slide" duration={300}>
380
+ <SafeAreaView style={[styles.container, { backgroundColor: theme.colors.background }]}>
381
+ <View style={styles.header}>
382
+ <Text style={[styles.title, { color: theme.colors.text }]}>
383
+ AI Studio
384
+ </Text>
385
+ <View style={styles.headerActions}>
386
+ <Badge variant="primary" size="sm">
387
+ v3.0.0
388
+ </Badge>
389
+ </View>
390
+ </View>
391
+
392
+ <TabbedInterface
393
+ tabs={aiTabs}
394
+ activeTabId={activeTab}
395
+ onTabChange={handleTabChange}
396
+ variant="pills"
397
+ showLabels={true}
398
+ scrollable={true}
399
+ hapticFeedback={true}
400
+ style={styles.tabbedInterface}
401
+ />
402
+ </SafeAreaView>
403
+ </PageTransition>
404
+ </AIProvider>
405
+ );
406
+ }
407
+
408
+ const styles = StyleSheet.create({
409
+ container: {
410
+ flex: 1,
411
+ },
412
+ header: {
413
+ flexDirection: 'row',
414
+ justifyContent: 'space-between',
415
+ alignItems: 'center',
416
+ paddingHorizontal: 16,
417
+ paddingVertical: 12,
418
+ borderBottomWidth: 1,
419
+ borderBottomColor: 'rgba(0, 0, 0, 0.1)',
420
+ },
421
+ title: {
422
+ fontSize: 28,
423
+ fontWeight: '700',
424
+ },
425
+ headerActions: {
426
+ flexDirection: 'row',
427
+ alignItems: 'center',
428
+ gap: 8,
429
+ },
430
+ tabbedInterface: {
431
+ flex: 1,
432
+ },
433
+ tabContent: {
434
+ flex: 1,
435
+ },
436
+ card: {
437
+ marginBottom: 16,
438
+ padding: 16,
439
+ },
440
+ cardTitle: {
441
+ fontSize: 18,
442
+ fontWeight: '600',
443
+ marginBottom: 16,
444
+ },
445
+ setupStatus: {
446
+ marginBottom: 0,
447
+ },
448
+ statsCard: {
449
+ backgroundColor: 'rgba(59, 130, 246, 0.05)',
450
+ },
451
+ statsGrid: {
452
+ marginTop: 8,
453
+ },
454
+ statItem: {
455
+ alignItems: 'center',
456
+ padding: 12,
457
+ },
458
+ statNumber: {
459
+ fontSize: 24,
460
+ fontWeight: '700',
461
+ marginBottom: 4,
462
+ },
463
+ statLabel: {
464
+ fontSize: 12,
465
+ textAlign: 'center',
466
+ },
467
+ quickActions: {
468
+ marginTop: 8,
469
+ },
470
+ quickActionButton: {
471
+ flexDirection: 'column',
472
+ alignItems: 'center',
473
+ justifyContent: 'center',
474
+ height: 80,
475
+ gap: 8,
476
+ },
477
+ quickActionText: {
478
+ fontSize: 12,
479
+ fontWeight: '500',
480
+ color: '#64748b',
481
+ },
482
+ recentList: {
483
+ maxHeight: 300,
484
+ },
485
+ recentItem: {
486
+ marginBottom: 8,
487
+ },
488
+ recentItemContent: {
489
+ flexDirection: 'row',
490
+ alignItems: 'center',
491
+ padding: 12,
492
+ gap: 12,
493
+ },
494
+ recentItemIcon: {
495
+ width: 32,
496
+ height: 32,
497
+ borderRadius: 16,
498
+ backgroundColor: 'rgba(59, 130, 246, 0.1)',
499
+ alignItems: 'center',
500
+ justifyContent: 'center',
501
+ },
502
+ recentItemText: {
503
+ flex: 1,
504
+ },
505
+ recentItemTitle: {
506
+ fontSize: 14,
507
+ fontWeight: '500',
508
+ marginBottom: 2,
509
+ },
510
+ recentItemTime: {
511
+ fontSize: 12,
512
+ },
513
+ aiGenerator: {
514
+ minHeight: 400,
515
+ },
516
+ chatContainer: {
517
+ flex: 1,
518
+ },
519
+ aiChat: {
520
+ flex: 1,
521
+ },
522
+ });