@umituz/react-native-ai-generation-content 1.83.92 → 1.83.93
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.83.
|
|
3
|
+
"version": "1.83.93",
|
|
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",
|
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
* AI-generated creations gallery with filtering, sharing, and management
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
7
|
-
console.log("📍 [LIFECYCLE] creations/index.ts - Module loading");
|
|
8
|
-
}
|
|
9
|
-
|
|
10
6
|
// Domain Layer
|
|
11
7
|
export * from "./domain-exports";
|
|
12
8
|
|
|
@@ -56,12 +56,7 @@ export const GalleryHeader: React.FC<GalleryHeaderProps> = ({
|
|
|
56
56
|
{filterButtons.map((btn: FilterButtonConfig) => (
|
|
57
57
|
<TouchableOpacity
|
|
58
58
|
key={btn.id}
|
|
59
|
-
onPress={
|
|
60
|
-
if (__DEV__) {
|
|
61
|
-
console.log(`[GalleryHeader] ${btn.id} filter pressed`);
|
|
62
|
-
}
|
|
63
|
-
btn.onPress();
|
|
64
|
-
}}
|
|
59
|
+
onPress={btn.onPress}
|
|
65
60
|
style={[styles.filterButton, btn.isActive && styles.filterButtonActive]}
|
|
66
61
|
activeOpacity={0.7}
|
|
67
62
|
>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import type { Creation } from "../../domain/entities/Creation";
|
|
3
|
+
|
|
4
|
+
export interface CreationsStats {
|
|
5
|
+
readonly total: number;
|
|
6
|
+
readonly thisWeek: number;
|
|
7
|
+
readonly processing: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const WEEK_MS = 7 * 24 * 60 * 60 * 1000;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* useCreationsStats
|
|
14
|
+
* Computes summary statistics from a list of creations.
|
|
15
|
+
* Accepts the raw data array from useCreations.
|
|
16
|
+
*/
|
|
17
|
+
export function useCreationsStats(creations: Creation[] | undefined): CreationsStats {
|
|
18
|
+
return useMemo(() => {
|
|
19
|
+
if (!creations?.length) return { total: 0, thisWeek: 0, processing: 0 };
|
|
20
|
+
|
|
21
|
+
const weekAgo = new Date(Date.now() - WEEK_MS);
|
|
22
|
+
let thisWeek = 0;
|
|
23
|
+
let processing = 0;
|
|
24
|
+
|
|
25
|
+
for (const c of creations) {
|
|
26
|
+
if (new Date(c.createdAt) > weekAgo) thisWeek++;
|
|
27
|
+
if (c.status === "processing" || c.status === "queued" || c.status === "pending") processing++;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return { total: creations.length, thisWeek, processing };
|
|
31
|
+
}, [creations]);
|
|
32
|
+
}
|
|
@@ -57,5 +57,9 @@ export {
|
|
|
57
57
|
getTranslatedTypes,
|
|
58
58
|
} from "./presentation/utils/gallery-filters";
|
|
59
59
|
|
|
60
|
+
// Stats
|
|
61
|
+
export { useCreationsStats } from "./presentation/hooks/useCreationsStats";
|
|
62
|
+
export type { CreationsStats } from "./presentation/hooks/useCreationsStats";
|
|
63
|
+
|
|
60
64
|
// Screens
|
|
61
65
|
export { CreationsGalleryScreen } from "./presentation/screens/CreationsGalleryScreen";
|