@digilogiclabs/create-saas-app 1.14.1 → 1.17.1

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 (147) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +285 -39
  3. package/bin/index.js +1 -1
  4. package/dist/.tsbuildinfo +1 -1
  5. package/dist/cli/prompts/project-setup.d.ts.map +1 -1
  6. package/dist/cli/prompts/project-setup.js +49 -12
  7. package/dist/cli/prompts/project-setup.js.map +1 -1
  8. package/dist/generators/template-generator.d.ts.map +1 -1
  9. package/dist/generators/template-generator.js +27 -4
  10. package/dist/generators/template-generator.js.map +1 -1
  11. package/dist/templates/mobile/base/template/App.tsx +2 -0
  12. package/dist/templates/mobile/ui-auth-payments/template/.env.example +20 -0
  13. package/dist/templates/mobile/ui-auth-payments/template/README.md +218 -0
  14. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/_layout.tsx +153 -0
  15. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/analytics.tsx +668 -0
  16. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/billing.tsx +743 -0
  17. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +757 -0
  18. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/orders.tsx +402 -0
  19. package/dist/templates/mobile/ui-auth-payments/template/app/(tabs)/profile.tsx +580 -0
  20. package/dist/templates/mobile/ui-auth-payments/template/app/_layout.tsx +127 -0
  21. package/dist/templates/mobile/ui-auth-payments/template/app/auth/login.tsx +246 -0
  22. package/dist/templates/mobile/ui-auth-payments/template/app/auth/signup.tsx +362 -0
  23. package/dist/templates/mobile/ui-auth-payments/template/app/onboarding/index.tsx +193 -0
  24. package/dist/templates/mobile/ui-auth-payments/template/app/tour/index.tsx +272 -0
  25. package/dist/templates/mobile/ui-auth-payments/template/app.json +93 -0
  26. package/dist/templates/mobile/ui-auth-payments/template/babel.config.js +23 -0
  27. package/dist/templates/mobile/ui-auth-payments/template/eas.json +45 -0
  28. package/dist/templates/mobile/ui-auth-payments/template/expo-env.d.ts +3 -0
  29. package/dist/templates/mobile/ui-auth-payments/template/jest-setup.ts +74 -0
  30. package/dist/templates/mobile/ui-auth-payments/template/metro.config.js +11 -0
  31. package/dist/templates/mobile/ui-auth-payments/template/package.json +106 -0
  32. package/dist/templates/mobile/ui-auth-payments/template/tsconfig.json +31 -0
  33. package/dist/templates/mobile/ui-auth-payments-ai/template/.env.example +23 -0
  34. package/dist/templates/mobile/ui-auth-payments-ai/template/README.md +254 -0
  35. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/_layout.tsx +169 -0
  36. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/ai.tsx +522 -0
  37. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/analytics.tsx +668 -0
  38. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/billing.tsx +743 -0
  39. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/index.tsx +676 -0
  40. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/orders.tsx +402 -0
  41. package/dist/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/profile.tsx +580 -0
  42. package/dist/templates/mobile/ui-auth-payments-ai/template/app/_layout.tsx +127 -0
  43. package/dist/templates/mobile/ui-auth-payments-ai/template/app/auth/login.tsx +246 -0
  44. package/dist/templates/mobile/ui-auth-payments-ai/template/app/auth/signup.tsx +362 -0
  45. package/dist/templates/mobile/ui-auth-payments-ai/template/app/onboarding/index.tsx +193 -0
  46. package/dist/templates/mobile/ui-auth-payments-ai/template/app/tour/index.tsx +272 -0
  47. package/dist/templates/mobile/ui-auth-payments-ai/template/app.json +93 -0
  48. package/dist/templates/mobile/ui-auth-payments-ai/template/babel.config.js +23 -0
  49. package/dist/templates/mobile/ui-auth-payments-ai/template/eas.json +45 -0
  50. package/dist/templates/mobile/ui-auth-payments-ai/template/expo-env.d.ts +3 -0
  51. package/dist/templates/mobile/ui-auth-payments-ai/template/jest-setup.ts +74 -0
  52. package/dist/templates/mobile/ui-auth-payments-ai/template/metro.config.js +11 -0
  53. package/dist/templates/mobile/ui-auth-payments-ai/template/package.json +108 -0
  54. package/dist/templates/mobile/ui-auth-payments-ai/template/tsconfig.json +31 -0
  55. package/dist/templates/web/base/template/src/app/dashboard/page.tsx +62 -20
  56. package/dist/templates/web/base/template/src/app/loading.tsx +45 -27
  57. package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +2 -0
  58. package/dist/templates/web/ui-auth/template/package.json +1 -1
  59. package/dist/templates/web/ui-auth/template/src/app/loading.tsx +30 -12
  60. package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +2 -0
  61. package/dist/templates/web/ui-auth/template/src/components/shared/header.tsx +43 -2
  62. package/dist/templates/web/ui-auth-ai/template/package.json +1 -1
  63. package/dist/templates/web/ui-auth-payments/template/package.json +1 -1
  64. package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +69 -17
  65. package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +2 -0
  66. package/dist/templates/web/ui-auth-payments-ai/template/package.json +1 -1
  67. package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +218 -7
  68. package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +62 -9
  69. package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +364 -0
  70. package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +532 -0
  71. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +70 -51
  72. package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +76 -60
  73. package/dist/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +2 -0
  74. package/dist/templates/web/ui-auth-payments-audio/template/package.json +1 -1
  75. package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +71 -17
  76. package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +2 -0
  77. package/dist/templates/web/ui-auth-payments-video/template/package.json +1 -1
  78. package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +2 -0
  79. package/package.json +1 -1
  80. package/src/templates/mobile/base/template/App.tsx +2 -0
  81. package/src/templates/mobile/ui-auth-payments/template/.env.example +20 -0
  82. package/src/templates/mobile/ui-auth-payments/template/README.md +218 -0
  83. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/_layout.tsx +153 -0
  84. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/analytics.tsx +668 -0
  85. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/billing.tsx +743 -0
  86. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/index.tsx +757 -0
  87. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/orders.tsx +402 -0
  88. package/src/templates/mobile/ui-auth-payments/template/app/(tabs)/profile.tsx +580 -0
  89. package/src/templates/mobile/ui-auth-payments/template/app/_layout.tsx +127 -0
  90. package/src/templates/mobile/ui-auth-payments/template/app/auth/login.tsx +246 -0
  91. package/src/templates/mobile/ui-auth-payments/template/app/auth/signup.tsx +362 -0
  92. package/src/templates/mobile/ui-auth-payments/template/app/onboarding/index.tsx +193 -0
  93. package/src/templates/mobile/ui-auth-payments/template/app/tour/index.tsx +272 -0
  94. package/src/templates/mobile/ui-auth-payments/template/app.json +93 -0
  95. package/src/templates/mobile/ui-auth-payments/template/babel.config.js +23 -0
  96. package/src/templates/mobile/ui-auth-payments/template/eas.json +45 -0
  97. package/src/templates/mobile/ui-auth-payments/template/expo-env.d.ts +3 -0
  98. package/src/templates/mobile/ui-auth-payments/template/jest-setup.ts +74 -0
  99. package/src/templates/mobile/ui-auth-payments/template/metro.config.js +11 -0
  100. package/src/templates/mobile/ui-auth-payments/template/package.json +106 -0
  101. package/src/templates/mobile/ui-auth-payments/template/tsconfig.json +31 -0
  102. package/src/templates/mobile/ui-auth-payments-ai/template/.env.example +23 -0
  103. package/src/templates/mobile/ui-auth-payments-ai/template/README.md +254 -0
  104. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/_layout.tsx +169 -0
  105. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/ai.tsx +522 -0
  106. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/analytics.tsx +668 -0
  107. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/billing.tsx +743 -0
  108. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/index.tsx +676 -0
  109. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/orders.tsx +402 -0
  110. package/src/templates/mobile/ui-auth-payments-ai/template/app/(tabs)/profile.tsx +580 -0
  111. package/src/templates/mobile/ui-auth-payments-ai/template/app/_layout.tsx +127 -0
  112. package/src/templates/mobile/ui-auth-payments-ai/template/app/auth/login.tsx +246 -0
  113. package/src/templates/mobile/ui-auth-payments-ai/template/app/auth/signup.tsx +362 -0
  114. package/src/templates/mobile/ui-auth-payments-ai/template/app/onboarding/index.tsx +193 -0
  115. package/src/templates/mobile/ui-auth-payments-ai/template/app/tour/index.tsx +272 -0
  116. package/src/templates/mobile/ui-auth-payments-ai/template/app.json +93 -0
  117. package/src/templates/mobile/ui-auth-payments-ai/template/babel.config.js +23 -0
  118. package/src/templates/mobile/ui-auth-payments-ai/template/eas.json +45 -0
  119. package/src/templates/mobile/ui-auth-payments-ai/template/expo-env.d.ts +3 -0
  120. package/src/templates/mobile/ui-auth-payments-ai/template/jest-setup.ts +74 -0
  121. package/src/templates/mobile/ui-auth-payments-ai/template/metro.config.js +11 -0
  122. package/src/templates/mobile/ui-auth-payments-ai/template/package.json +108 -0
  123. package/src/templates/mobile/ui-auth-payments-ai/template/tsconfig.json +31 -0
  124. package/src/templates/web/base/template/src/app/dashboard/page.tsx +62 -20
  125. package/src/templates/web/base/template/src/app/loading.tsx +45 -27
  126. package/src/templates/web/base/template/src/components/providers/app-providers.tsx +2 -0
  127. package/src/templates/web/ui-auth/template/package.json +1 -1
  128. package/src/templates/web/ui-auth/template/src/app/loading.tsx +30 -12
  129. package/src/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +2 -0
  130. package/src/templates/web/ui-auth/template/src/components/shared/header.tsx +43 -2
  131. package/src/templates/web/ui-auth-ai/template/package.json +1 -1
  132. package/src/templates/web/ui-auth-payments/template/package.json +1 -1
  133. package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +69 -17
  134. package/src/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +2 -0
  135. package/src/templates/web/ui-auth-payments-ai/template/package.json +1 -1
  136. package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +218 -7
  137. package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +62 -9
  138. package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +364 -0
  139. package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +532 -0
  140. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +70 -51
  141. package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +76 -60
  142. package/src/templates/web/ui-auth-payments-ai/template/src/components/providers/app-providers.tsx +2 -0
  143. package/src/templates/web/ui-auth-payments-audio/template/package.json +1 -1
  144. package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +71 -17
  145. package/src/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +2 -0
  146. package/src/templates/web/ui-auth-payments-video/template/package.json +1 -1
  147. package/src/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +2 -0
@@ -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
+ });