@umituz/react-native-ai-generation-content 1.37.28 → 1.37.29

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.37.28",
3
+ "version": "1.37.29",
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",
@@ -1,22 +1,15 @@
1
1
  /**
2
2
  * CreationPreview Component
3
3
  * Smart wrapper that delegates to CreationImagePreview or CreationVideoPreview
4
- * based on creation type
4
+ * based on output content type (not creation type)
5
5
  */
6
6
 
7
7
  import React from "react";
8
+ import { isVideoUrl } from "@umituz/react-native-design-system";
8
9
  import type { CreationStatus, CreationTypeId } from "../../domain/types";
9
10
  import { CreationImagePreview } from "./CreationImagePreview";
10
11
  import { CreationVideoPreview } from "./CreationVideoPreview";
11
12
 
12
- /** Video creation types */
13
- const VIDEO_TYPES: CreationTypeId[] = ["text-to-video", "image-to-video"];
14
-
15
- /** Check if creation type is a video type */
16
- function isVideoType(type?: CreationTypeId | string): boolean {
17
- return VIDEO_TYPES.includes(type as CreationTypeId);
18
- }
19
-
20
13
  interface CreationPreviewProps {
21
14
  /** Preview image/thumbnail URL */
22
15
  readonly uri?: string | null;
@@ -43,11 +36,15 @@ export function CreationPreview({
43
36
  height,
44
37
  showLoadingIndicator = true,
45
38
  }: CreationPreviewProps) {
46
- // For video types, use CreationVideoPreview
47
- if (isVideoType(type)) {
39
+ // Determine preview type based on URI content, not creation type
40
+ // This handles scenario-based videos (solo_martial_artist, ski_resort, etc.)
41
+ const hasVideoContent = uri && isVideoUrl(uri);
42
+
43
+ // For video content, use CreationVideoPreview
44
+ if (hasVideoContent) {
48
45
  return (
49
46
  <CreationVideoPreview
50
- thumbnailUrl={thumbnailUrl || uri}
47
+ thumbnailUrl={thumbnailUrl}
51
48
  videoUrl={uri}
52
49
  status={status}
53
50
  type={type as CreationTypeId}
@@ -58,7 +55,7 @@ export function CreationPreview({
58
55
  );
59
56
  }
60
57
 
61
- // For image types, use CreationImagePreview
58
+ // For image content, use CreationImagePreview
62
59
  return (
63
60
  <CreationImagePreview
64
61
  uri={uri}