@umituz/react-native-ai-generation-content 1.17.122 → 1.17.123
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
package/src/index.ts
CHANGED
|
@@ -321,6 +321,7 @@ export {
|
|
|
321
321
|
// Headers
|
|
322
322
|
FeatureHeader,
|
|
323
323
|
AIGenScreenHeader,
|
|
324
|
+
CreditBadge,
|
|
324
325
|
|
|
325
326
|
// Photo Upload
|
|
326
327
|
PhotoUploadCard,
|
|
@@ -380,6 +381,7 @@ export type {
|
|
|
380
381
|
FeatureHeaderProps,
|
|
381
382
|
AIGenScreenHeaderProps,
|
|
382
383
|
NavigationButtonType,
|
|
384
|
+
CreditBadgeProps,
|
|
383
385
|
|
|
384
386
|
// Photo Upload
|
|
385
387
|
PhotoUploadCardProps,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View, StyleSheet } from "react-native";
|
|
3
|
+
import {
|
|
4
|
+
AtomicText,
|
|
5
|
+
AtomicIcon,
|
|
6
|
+
useAppDesignTokens,
|
|
7
|
+
} from "@umituz/react-native-design-system";
|
|
8
|
+
|
|
9
|
+
export interface CreditBadgeProps {
|
|
10
|
+
readonly credits: number;
|
|
11
|
+
readonly iconName?: string;
|
|
12
|
+
readonly compact?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const CreditBadge: React.FC<CreditBadgeProps> = ({
|
|
16
|
+
credits,
|
|
17
|
+
iconName = "flash",
|
|
18
|
+
compact = false,
|
|
19
|
+
}) => {
|
|
20
|
+
const tokens = useAppDesignTokens();
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<View
|
|
24
|
+
style={[
|
|
25
|
+
styles.container,
|
|
26
|
+
compact && styles.compact,
|
|
27
|
+
{ backgroundColor: tokens.colors.surface },
|
|
28
|
+
]}
|
|
29
|
+
>
|
|
30
|
+
<AtomicIcon name={iconName} size="sm" color="warning" />
|
|
31
|
+
<AtomicText
|
|
32
|
+
type={compact ? "labelSmall" : "labelMedium"}
|
|
33
|
+
style={[styles.text, { color: tokens.colors.textPrimary }]}
|
|
34
|
+
>
|
|
35
|
+
{credits}
|
|
36
|
+
</AtomicText>
|
|
37
|
+
</View>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const styles = StyleSheet.create({
|
|
42
|
+
container: {
|
|
43
|
+
flexDirection: "row",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
paddingHorizontal: 10,
|
|
46
|
+
paddingVertical: 6,
|
|
47
|
+
borderRadius: 16,
|
|
48
|
+
gap: 4,
|
|
49
|
+
},
|
|
50
|
+
compact: {
|
|
51
|
+
paddingHorizontal: 8,
|
|
52
|
+
paddingVertical: 4,
|
|
53
|
+
borderRadius: 12,
|
|
54
|
+
},
|
|
55
|
+
text: {
|
|
56
|
+
fontWeight: "600",
|
|
57
|
+
},
|
|
58
|
+
});
|