@umituz/react-native-ai-generation-content 1.27.3 → 1.27.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-ai-generation-content",
3
- "version": "1.27.3",
3
+ "version": "1.27.4",
4
4
  "description": "Provider-agnostic AI generation orchestration for React Native with result preview components",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -26,6 +26,7 @@ export function CreationCard({
26
26
  showActions = true,
27
27
  statusText,
28
28
  typeText,
29
+ titleText,
29
30
  formatDate,
30
31
  isSharing = false,
31
32
  isDownloadAvailable = true,
@@ -43,7 +44,7 @@ export function CreationCard({
43
44
  }
44
45
 
45
46
  const previewUrl = getPreviewUrl(creation.output) || creation.uri;
46
- const title = getCreationTitle(creation.prompt, creation.type as CreationTypeId);
47
+ const title = titleText || getCreationTitle(creation.prompt, creation.type as CreationTypeId);
47
48
  const formattedDate = useCreationDateFormatter(creation.createdAt, formatDate);
48
49
  const actions = useCreationCardActions({
49
50
  callbacks,
@@ -49,6 +49,8 @@ export interface CreationCardProps {
49
49
  readonly statusText?: string;
50
50
  /** Custom type text (for i18n) */
51
51
  readonly typeText?: string;
52
+ /** Custom title text - overrides prompt-based title */
53
+ readonly titleText?: string;
52
54
  /** Date formatter function */
53
55
  readonly formatDate?: (date: Date) => string;
54
56
  /** Is sharing in progress */
@@ -142,9 +142,18 @@ export function CreationsGalleryScreen({
142
142
  return buttons;
143
143
  }, [showStatusFilter, showMediaFilter, filters, t, config.translations]);
144
144
 
145
+ const getScenarioTitle = useCallback((type: string): string => {
146
+ const typeConfig = config.types?.find((tc) => tc.id === type);
147
+ if (typeConfig?.labelKey) {
148
+ return t(typeConfig.labelKey);
149
+ }
150
+ return type.split("_").map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
151
+ }, [config.types, t]);
152
+
145
153
  const renderItem = useCallback(({ item }: { item: Creation }) => (
146
154
  <CreationCard
147
155
  creation={item}
156
+ titleText={getScenarioTitle(item.type)}
148
157
  callbacks={{
149
158
  onPress: () => handleCardPress(item),
150
159
  onShare: async () => handleShareCard(item),
@@ -152,7 +161,7 @@ export function CreationsGalleryScreen({
152
161
  onFavorite: () => handleFavorite(item, !item.isFavorite),
153
162
  }}
154
163
  />
155
- ), [handleShareCard, handleDelete, handleFavorite, handleCardPress]);
164
+ ), [handleShareCard, handleDelete, handleFavorite, handleCardPress, getScenarioTitle]);
156
165
 
157
166
  const renderHeader = useMemo(() => {
158
167
  if ((!creations || creations.length === 0) && !isLoading) return null;