@umituz/web-dashboard 3.1.5 → 3.1.6
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/web-dashboard",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.6",
|
|
4
4
|
"description": "Dashboard Layout System - Comprehensive analytics, calendar, customizable layouts, and config-based architecture",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -11,7 +11,7 @@ import type { BillingPortalProps } from "../types/billing";
|
|
|
11
11
|
import { UsageCard } from "./UsageCard";
|
|
12
12
|
import { PaymentMethodsList } from "./PaymentMethodsList";
|
|
13
13
|
import { InvoiceCard } from "./InvoiceCard";
|
|
14
|
-
import { getDaysRemaining, getStatusColor, getStatusLabel, formatPrice } from "../utils/billing";
|
|
14
|
+
import { getDaysRemaining, getStatusColor, getStatusLabel, formatPrice, getPlanPrice } from "../utils/billing";
|
|
15
15
|
|
|
16
16
|
export const BillingPortal = ({
|
|
17
17
|
billing,
|
|
@@ -174,6 +174,7 @@ export function getInvoiceStatusColor(status: InvoiceStatus): string {
|
|
|
174
174
|
paid: "text-green-600 dark:text-green-500",
|
|
175
175
|
void: "text-gray-600 dark:text-gray-500",
|
|
176
176
|
uncollectible: "text-red-600 dark:text-red-500",
|
|
177
|
+
refunded: "text-blue-600 dark:text-blue-500",
|
|
177
178
|
};
|
|
178
179
|
|
|
179
180
|
return colorMap[status] || "text-gray-600";
|
|
@@ -192,6 +193,7 @@ export function getInvoiceStatusLabel(status: InvoiceStatus): string {
|
|
|
192
193
|
paid: "Paid",
|
|
193
194
|
void: "Void",
|
|
194
195
|
uncollectible: "Uncollectible",
|
|
196
|
+
refunded: "Refunded",
|
|
195
197
|
};
|
|
196
198
|
|
|
197
199
|
return labelMap[status] || status;
|
|
@@ -31,7 +31,8 @@ class FirebaseCalendarDatabase implements ICalendarDatabase {
|
|
|
31
31
|
async getItems(userId: string): Promise<ContentItem[]> {
|
|
32
32
|
// Lazy load Firebase
|
|
33
33
|
const { collection, query, where, getDocs } = await import('firebase/firestore');
|
|
34
|
-
const {
|
|
34
|
+
const { getFirebaseDB } = await import('@umituz/web-firebase');
|
|
35
|
+
const db = getFirebaseDB();
|
|
35
36
|
|
|
36
37
|
const calendarQuery = query(
|
|
37
38
|
collection(db as any, 'calendar_items'),
|
|
@@ -76,7 +77,8 @@ class FirebaseCalendarDatabase implements ICalendarDatabase {
|
|
|
76
77
|
|
|
77
78
|
async getItemById(id: string): Promise<ContentItem | null> {
|
|
78
79
|
const { doc, getDoc } = await import('firebase/firestore');
|
|
79
|
-
const {
|
|
80
|
+
const { getFirebaseDB } = await import('@umituz/web-firebase');
|
|
81
|
+
const db = getFirebaseDB();
|
|
80
82
|
|
|
81
83
|
const docRef = doc(db as any, 'calendar_items', id);
|
|
82
84
|
const snap = await getDoc(docRef);
|
|
@@ -93,7 +95,8 @@ class FirebaseCalendarDatabase implements ICalendarDatabase {
|
|
|
93
95
|
|
|
94
96
|
async createItem(userId: string, item: CreateContentItemParams): Promise<ContentItem> {
|
|
95
97
|
const { collection, addDoc, serverTimestamp } = await import('firebase/firestore');
|
|
96
|
-
const {
|
|
98
|
+
const { getFirebaseDB } = await import('@umituz/web-firebase');
|
|
99
|
+
const db = getFirebaseDB();
|
|
97
100
|
|
|
98
101
|
const docRef = await addDoc(collection(db as any, 'calendar_items'), {
|
|
99
102
|
...item,
|
|
@@ -114,7 +117,8 @@ class FirebaseCalendarDatabase implements ICalendarDatabase {
|
|
|
114
117
|
|
|
115
118
|
async updateItem(id: string, updates: UpdateContentItemParams): Promise<void> {
|
|
116
119
|
const { doc, updateDoc, serverTimestamp } = await import('firebase/firestore');
|
|
117
|
-
const {
|
|
120
|
+
const { getFirebaseDB } = await import('@umituz/web-firebase');
|
|
121
|
+
const db = getFirebaseDB();
|
|
118
122
|
|
|
119
123
|
const docRef = doc(db as any, 'calendar_items', id);
|
|
120
124
|
|
|
@@ -133,7 +137,8 @@ class FirebaseCalendarDatabase implements ICalendarDatabase {
|
|
|
133
137
|
|
|
134
138
|
async deleteItem(id: string): Promise<void> {
|
|
135
139
|
const { doc, deleteDoc } = await import('firebase/firestore');
|
|
136
|
-
const {
|
|
140
|
+
const { getFirebaseDB } = await import('@umituz/web-firebase');
|
|
141
|
+
const db = getFirebaseDB();
|
|
137
142
|
|
|
138
143
|
const docRef = doc(db as any, 'calendar_items', id);
|
|
139
144
|
await deleteDoc(docRef);
|