@streamoid/settings 0.15.1 → 0.15.2
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/dist/index.d.mts +33 -2
- package/dist/index.d.ts +33 -2
- package/dist/index.js +262 -258
- package/dist/index.mjs +262 -258
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10611,6 +10611,34 @@ async function loadCurrentPlan(fetchCurrentPlan) {
|
|
|
10611
10611
|
return { subscription, entitlement, paid: hasPaidFeatures({ entitlement, subscription }) };
|
|
10612
10612
|
}
|
|
10613
10613
|
|
|
10614
|
+
// src/billing-layout.ts
|
|
10615
|
+
var BILLING_TABLE_MIN_HEIGHT = 300;
|
|
10616
|
+
var BILLING_TABLE_FRAME_STYLE = {
|
|
10617
|
+
flex: "1 0 auto",
|
|
10618
|
+
minHeight: BILLING_TABLE_MIN_HEIGHT,
|
|
10619
|
+
backgroundColor: "var(--alias-surface-base)",
|
|
10620
|
+
borderRadius: "var(--radius-3xl)",
|
|
10621
|
+
border: "1px solid var(--alias-border-subtle)",
|
|
10622
|
+
overflow: "clip"
|
|
10623
|
+
};
|
|
10624
|
+
var BILLING_TABLE_PAGER_STYLE = {
|
|
10625
|
+
position: "sticky",
|
|
10626
|
+
bottom: 0,
|
|
10627
|
+
zIndex: 2,
|
|
10628
|
+
backgroundColor: "var(--alias-surface-canvas)",
|
|
10629
|
+
paddingTop: "var(--spacing-xl)",
|
|
10630
|
+
paddingBottom: "var(--spacing-md)"
|
|
10631
|
+
};
|
|
10632
|
+
function productsForCountry(products, country) {
|
|
10633
|
+
const currency = country?.trim().toUpperCase() === "IN" ? "inr" : "usd";
|
|
10634
|
+
return products.map((product) => ({
|
|
10635
|
+
...product,
|
|
10636
|
+
prices: product.prices.filter(
|
|
10637
|
+
(price) => price.currency?.toLowerCase() === currency
|
|
10638
|
+
)
|
|
10639
|
+
})).filter((product) => product.prices.length > 0);
|
|
10640
|
+
}
|
|
10641
|
+
|
|
10614
10642
|
// src/usage-logs.ts
|
|
10615
10643
|
var USAGE_LOGS_PAGE_SIZE = 50;
|
|
10616
10644
|
var USAGE_LOGS_EXPORT_BATCH_SIZE = 100;
|
|
@@ -11554,7 +11582,6 @@ function BillingTabBar({
|
|
|
11554
11582
|
}
|
|
11555
11583
|
);
|
|
11556
11584
|
}
|
|
11557
|
-
var BILLING_TABLE_MIN_HEIGHT = 300;
|
|
11558
11585
|
function InvoiceHistoryTable({
|
|
11559
11586
|
invoices,
|
|
11560
11587
|
loading,
|
|
@@ -11628,64 +11655,51 @@ function InvoiceHistoryTable({
|
|
|
11628
11655
|
}
|
|
11629
11656
|
);
|
|
11630
11657
|
}
|
|
11631
|
-
return /* @__PURE__ */ jsxs26(
|
|
11632
|
-
|
|
11633
|
-
|
|
11634
|
-
|
|
11635
|
-
|
|
11636
|
-
|
|
11637
|
-
|
|
11638
|
-
|
|
11639
|
-
|
|
11640
|
-
|
|
11641
|
-
|
|
11642
|
-
|
|
11643
|
-
|
|
11644
|
-
|
|
11658
|
+
return /* @__PURE__ */ jsxs26("div", { className: "w-full relative", style: BILLING_TABLE_FRAME_STYLE, children: [
|
|
11659
|
+
/* @__PURE__ */ jsx29(
|
|
11660
|
+
"div",
|
|
11661
|
+
{
|
|
11662
|
+
style: {
|
|
11663
|
+
position: "sticky",
|
|
11664
|
+
top: 0,
|
|
11665
|
+
zIndex: 1,
|
|
11666
|
+
backgroundColor: "var(--alias-surface-base)"
|
|
11667
|
+
},
|
|
11668
|
+
children: /* @__PURE__ */ jsx29(ScBillingHistoryHeader, {})
|
|
11669
|
+
}
|
|
11670
|
+
),
|
|
11671
|
+
invoices.length === 0 && /* @__PURE__ */ jsx29(
|
|
11672
|
+
"div",
|
|
11673
|
+
{
|
|
11674
|
+
className: "flex items-center justify-center w-full",
|
|
11675
|
+
style: { padding: "var(--spacing-6xl)" },
|
|
11676
|
+
children: /* @__PURE__ */ jsx29(
|
|
11677
|
+
"span",
|
|
11645
11678
|
{
|
|
11646
11679
|
style: {
|
|
11647
|
-
|
|
11648
|
-
|
|
11649
|
-
|
|
11650
|
-
|
|
11680
|
+
fontFamily: "var(--font-family-font-family-body)",
|
|
11681
|
+
fontSize: "var(--font-size-font-size-sm)",
|
|
11682
|
+
fontWeight: 400,
|
|
11683
|
+
lineHeight: "var(--line-height-line-height-sm)",
|
|
11684
|
+
color: "var(--alias-text---icons-muted)"
|
|
11651
11685
|
},
|
|
11652
|
-
children:
|
|
11653
|
-
}
|
|
11654
|
-
),
|
|
11655
|
-
invoices.length === 0 && /* @__PURE__ */ jsx29(
|
|
11656
|
-
"div",
|
|
11657
|
-
{
|
|
11658
|
-
className: "flex items-center justify-center w-full",
|
|
11659
|
-
style: { padding: "var(--spacing-6xl)" },
|
|
11660
|
-
children: /* @__PURE__ */ jsx29(
|
|
11661
|
-
"span",
|
|
11662
|
-
{
|
|
11663
|
-
style: {
|
|
11664
|
-
fontFamily: "var(--font-family-font-family-body)",
|
|
11665
|
-
fontSize: "var(--font-size-font-size-sm)",
|
|
11666
|
-
fontWeight: 400,
|
|
11667
|
-
lineHeight: "var(--line-height-line-height-sm)",
|
|
11668
|
-
color: "var(--alias-text---icons-muted)"
|
|
11669
|
-
},
|
|
11670
|
-
children: "No invoices found"
|
|
11671
|
-
}
|
|
11672
|
-
)
|
|
11686
|
+
children: "No invoices found"
|
|
11673
11687
|
}
|
|
11674
|
-
)
|
|
11675
|
-
|
|
11676
|
-
|
|
11677
|
-
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
);
|
|
11688
|
+
)
|
|
11689
|
+
}
|
|
11690
|
+
),
|
|
11691
|
+
invoices.map((inv) => /* @__PURE__ */ jsx29(
|
|
11692
|
+
ScBillingHistoryTableList,
|
|
11693
|
+
{
|
|
11694
|
+
invoiceNumber: inv.transactionId ? `# ${inv.transactionId.slice(0, 16).toUpperCase()}` : "# INV-UNKNOWN",
|
|
11695
|
+
amount: inv.amountPaid != null ? `${currencySymbol}${inv.amountPaid.toFixed(2)}` : `${currencySymbol}${(inv.amount / 100).toFixed(2)}`,
|
|
11696
|
+
date: formatDate3(inv.createdAt),
|
|
11697
|
+
downloadLabel: "Download invoice",
|
|
11698
|
+
onClick: (e) => handleRowClick(e, inv)
|
|
11699
|
+
},
|
|
11700
|
+
inv._id
|
|
11701
|
+
))
|
|
11702
|
+
] });
|
|
11689
11703
|
}
|
|
11690
11704
|
function UsageLogsTable({
|
|
11691
11705
|
logs,
|
|
@@ -11767,181 +11781,168 @@ function UsageLogsTable({
|
|
|
11767
11781
|
}
|
|
11768
11782
|
);
|
|
11769
11783
|
}
|
|
11770
|
-
return /* @__PURE__ */ jsxs26(
|
|
11771
|
-
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
|
|
11779
|
-
|
|
11780
|
-
|
|
11781
|
-
|
|
11782
|
-
|
|
11783
|
-
"
|
|
11784
|
+
return /* @__PURE__ */ jsxs26("div", { className: "w-full relative", style: BILLING_TABLE_FRAME_STYLE, children: [
|
|
11785
|
+
/* @__PURE__ */ jsxs26(
|
|
11786
|
+
"div",
|
|
11787
|
+
{
|
|
11788
|
+
style: {
|
|
11789
|
+
position: "sticky",
|
|
11790
|
+
top: 0,
|
|
11791
|
+
zIndex: 1,
|
|
11792
|
+
background: "var(--alias-fill-neutral-neutral, #1a1a1a)",
|
|
11793
|
+
padding: "var(--spacing-xl, 0.75rem) var(--spacing-3xl, 1rem)",
|
|
11794
|
+
display: "flex",
|
|
11795
|
+
flexDirection: "row",
|
|
11796
|
+
gap: "var(--spacing-6xl, 1.5rem)",
|
|
11797
|
+
alignItems: "center"
|
|
11798
|
+
},
|
|
11799
|
+
children: [
|
|
11800
|
+
/* @__PURE__ */ jsx29(
|
|
11801
|
+
ScHeader,
|
|
11802
|
+
{
|
|
11803
|
+
text: "App",
|
|
11804
|
+
state: "none",
|
|
11805
|
+
style: { flex: 1, alignItems: "flex-start", gap: "0.25rem" }
|
|
11806
|
+
}
|
|
11807
|
+
),
|
|
11808
|
+
/* @__PURE__ */ jsx29(
|
|
11809
|
+
ScHeader,
|
|
11810
|
+
{
|
|
11811
|
+
text: "Activity",
|
|
11812
|
+
state: "none",
|
|
11813
|
+
style: { flex: 1, alignItems: "flex-start", gap: "0.25rem" }
|
|
11814
|
+
}
|
|
11815
|
+
),
|
|
11816
|
+
/* @__PURE__ */ jsx29(
|
|
11817
|
+
ScHeader,
|
|
11818
|
+
{
|
|
11819
|
+
text: "Used by",
|
|
11820
|
+
state: "none",
|
|
11821
|
+
style: { flexShrink: 0, width: "7.5rem" }
|
|
11822
|
+
}
|
|
11823
|
+
),
|
|
11824
|
+
showWorkspace && /* @__PURE__ */ jsx29(
|
|
11825
|
+
ScHeader,
|
|
11826
|
+
{
|
|
11827
|
+
text: "Workspace",
|
|
11828
|
+
state: "none",
|
|
11829
|
+
style: { flexShrink: 0, width: "9rem" }
|
|
11830
|
+
}
|
|
11831
|
+
),
|
|
11832
|
+
/* @__PURE__ */ jsx29(
|
|
11833
|
+
ScHeader,
|
|
11834
|
+
{
|
|
11835
|
+
text: "Date",
|
|
11836
|
+
state: "none",
|
|
11837
|
+
style: { flexShrink: 0, width: "7.5rem" }
|
|
11838
|
+
}
|
|
11839
|
+
),
|
|
11840
|
+
/* @__PURE__ */ jsx29(
|
|
11841
|
+
ScHeader,
|
|
11842
|
+
{
|
|
11843
|
+
text: "Credits",
|
|
11844
|
+
state: "none",
|
|
11845
|
+
style: {
|
|
11846
|
+
flexShrink: 0,
|
|
11847
|
+
width: "5rem",
|
|
11848
|
+
justifyContent: "flex-end"
|
|
11849
|
+
}
|
|
11850
|
+
}
|
|
11851
|
+
)
|
|
11852
|
+
]
|
|
11853
|
+
}
|
|
11854
|
+
),
|
|
11855
|
+
logs.length === 0 && /* @__PURE__ */ jsx29(
|
|
11856
|
+
"div",
|
|
11857
|
+
{
|
|
11858
|
+
className: "flex items-center justify-center w-full",
|
|
11859
|
+
style: { padding: "var(--spacing-6xl)" },
|
|
11860
|
+
children: /* @__PURE__ */ jsx29(
|
|
11861
|
+
"span",
|
|
11784
11862
|
{
|
|
11785
11863
|
style: {
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
|
-
|
|
11791
|
-
display: "flex",
|
|
11792
|
-
flexDirection: "row",
|
|
11793
|
-
gap: "var(--spacing-6xl, 1.5rem)",
|
|
11794
|
-
alignItems: "center"
|
|
11864
|
+
fontFamily: "var(--font-family-font-family-body)",
|
|
11865
|
+
fontSize: "var(--font-size-font-size-sm)",
|
|
11866
|
+
fontWeight: 400,
|
|
11867
|
+
lineHeight: "var(--line-height-line-height-sm)",
|
|
11868
|
+
color: "var(--alias-text---icons-muted)"
|
|
11795
11869
|
},
|
|
11796
|
-
children:
|
|
11797
|
-
/* @__PURE__ */ jsx29(
|
|
11798
|
-
ScHeader,
|
|
11799
|
-
{
|
|
11800
|
-
text: "App",
|
|
11801
|
-
state: "none",
|
|
11802
|
-
style: { flex: 1, alignItems: "flex-start", gap: "0.25rem" }
|
|
11803
|
-
}
|
|
11804
|
-
),
|
|
11805
|
-
/* @__PURE__ */ jsx29(
|
|
11806
|
-
ScHeader,
|
|
11807
|
-
{
|
|
11808
|
-
text: "Activity",
|
|
11809
|
-
state: "none",
|
|
11810
|
-
style: { flex: 1, alignItems: "flex-start", gap: "0.25rem" }
|
|
11811
|
-
}
|
|
11812
|
-
),
|
|
11813
|
-
/* @__PURE__ */ jsx29(
|
|
11814
|
-
ScHeader,
|
|
11815
|
-
{
|
|
11816
|
-
text: "Used by",
|
|
11817
|
-
state: "none",
|
|
11818
|
-
style: { flexShrink: 0, width: "7.5rem" }
|
|
11819
|
-
}
|
|
11820
|
-
),
|
|
11821
|
-
showWorkspace && /* @__PURE__ */ jsx29(
|
|
11822
|
-
ScHeader,
|
|
11823
|
-
{
|
|
11824
|
-
text: "Workspace",
|
|
11825
|
-
state: "none",
|
|
11826
|
-
style: { flexShrink: 0, width: "9rem" }
|
|
11827
|
-
}
|
|
11828
|
-
),
|
|
11829
|
-
/* @__PURE__ */ jsx29(
|
|
11830
|
-
ScHeader,
|
|
11831
|
-
{
|
|
11832
|
-
text: "Date",
|
|
11833
|
-
state: "none",
|
|
11834
|
-
style: { flexShrink: 0, width: "7.5rem" }
|
|
11835
|
-
}
|
|
11836
|
-
),
|
|
11837
|
-
/* @__PURE__ */ jsx29(
|
|
11838
|
-
ScHeader,
|
|
11839
|
-
{
|
|
11840
|
-
text: "Credits",
|
|
11841
|
-
state: "none",
|
|
11842
|
-
style: {
|
|
11843
|
-
flexShrink: 0,
|
|
11844
|
-
width: "5rem",
|
|
11845
|
-
justifyContent: "flex-end"
|
|
11846
|
-
}
|
|
11847
|
-
}
|
|
11848
|
-
)
|
|
11849
|
-
]
|
|
11870
|
+
children: "No usage logs found"
|
|
11850
11871
|
}
|
|
11851
|
-
)
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11872
|
+
)
|
|
11873
|
+
}
|
|
11874
|
+
),
|
|
11875
|
+
logs.map((log) => {
|
|
11876
|
+
const userName = log.triggeredByUserId ? userMap[log.triggeredByUserId] || "Unknown" : "System";
|
|
11877
|
+
const app = log.service?.serviceGroupName || "\u2014";
|
|
11878
|
+
const usedBy = usedByWorkspaceKey(log, currentWorkspaceId);
|
|
11879
|
+
const workspaceLabel2 = usedBy ? `Used by ${usedByNames[usedBy.toLowerCase()] ?? "another workspace"}` : "This workspace";
|
|
11880
|
+
const activity = log.type === "return" ? "Returned Credits" : log.meta?.info || "Credit usage";
|
|
11881
|
+
const isPositive = log.type === "return" || log.type === "add";
|
|
11882
|
+
const signedAmount = `${isPositive ? "+" : "-"}${log.amount}`;
|
|
11883
|
+
const amountColor = isPositive ? "var(--alias-text---icons-success, #1aa055)" : "var(--alias-text---icons-error, #d11a1a)";
|
|
11884
|
+
const rowCellRegular = {
|
|
11885
|
+
color: "var(--alias-text---icons-primary, #f5f5f5)",
|
|
11886
|
+
fontFamily: "var(--font-family-font-family-body)",
|
|
11887
|
+
fontSize: "var(--font-size-font-size-sm, 0.875rem)",
|
|
11888
|
+
fontWeight: 400,
|
|
11889
|
+
lineHeight: "var(--line-height-line-height-sm, 1.25rem)",
|
|
11890
|
+
textOverflow: "ellipsis",
|
|
11891
|
+
overflow: "hidden",
|
|
11892
|
+
whiteSpace: "nowrap"
|
|
11893
|
+
};
|
|
11894
|
+
return /* @__PURE__ */ jsxs26(
|
|
11895
|
+
"div",
|
|
11896
|
+
{
|
|
11897
|
+
style: {
|
|
11898
|
+
borderBottom: "0.0625rem solid var(--alias-border-subtle, #242424)",
|
|
11899
|
+
padding: "8px 16px",
|
|
11900
|
+
display: "flex",
|
|
11901
|
+
flexDirection: "row",
|
|
11902
|
+
gap: "var(--spacing-6xl, 1.5rem)",
|
|
11903
|
+
alignItems: "center"
|
|
11904
|
+
},
|
|
11905
|
+
children: [
|
|
11906
|
+
/* @__PURE__ */ jsx29("div", { style: { ...rowCellRegular, flex: 1 }, children: app }),
|
|
11907
|
+
/* @__PURE__ */ jsx29("div", { style: { ...rowCellRegular, flex: 1 }, children: activity }),
|
|
11908
|
+
/* @__PURE__ */ jsx29("div", { style: { ...rowCellRegular, width: "7.5rem" }, children: userName }),
|
|
11909
|
+
showWorkspace && /* @__PURE__ */ jsx29(
|
|
11910
|
+
"div",
|
|
11859
11911
|
{
|
|
11860
11912
|
style: {
|
|
11913
|
+
...rowCellRegular,
|
|
11914
|
+
width: "9rem",
|
|
11915
|
+
color: usedBy ? "var(--alias-text---icons-primary, #f5f5f5)" : "var(--alias-text---icons-muted)"
|
|
11916
|
+
},
|
|
11917
|
+
title: workspaceLabel2,
|
|
11918
|
+
children: workspaceLabel2
|
|
11919
|
+
}
|
|
11920
|
+
),
|
|
11921
|
+
/* @__PURE__ */ jsx29("div", { style: { ...rowCellRegular, width: "7.5rem" }, children: formatDate3(log.createdAt) }),
|
|
11922
|
+
/* @__PURE__ */ jsx29(
|
|
11923
|
+
"div",
|
|
11924
|
+
{
|
|
11925
|
+
style: {
|
|
11926
|
+
width: "5rem",
|
|
11927
|
+
color: amountColor,
|
|
11861
11928
|
fontFamily: "var(--font-family-font-family-body)",
|
|
11862
|
-
fontSize: "var(--font-size-font-size-
|
|
11863
|
-
fontWeight:
|
|
11864
|
-
lineHeight: "var(--line-height-line-height-
|
|
11865
|
-
|
|
11929
|
+
fontSize: "var(--font-size-font-size-md, 1rem)",
|
|
11930
|
+
fontWeight: 600,
|
|
11931
|
+
lineHeight: "var(--line-height-line-height-md, 1.5rem)",
|
|
11932
|
+
textAlign: "right",
|
|
11933
|
+
textOverflow: "ellipsis",
|
|
11934
|
+
overflow: "hidden",
|
|
11935
|
+
whiteSpace: "nowrap"
|
|
11866
11936
|
},
|
|
11867
|
-
children:
|
|
11937
|
+
children: signedAmount
|
|
11868
11938
|
}
|
|
11869
11939
|
)
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
const workspaceLabel2 = usedBy ? `Used by ${usedByNames[usedBy.toLowerCase()] ?? "another workspace"}` : "This workspace";
|
|
11877
|
-
const activity = log.type === "return" ? "Returned Credits" : log.meta?.info || "Credit usage";
|
|
11878
|
-
const isPositive = log.type === "return" || log.type === "add";
|
|
11879
|
-
const signedAmount = `${isPositive ? "+" : "-"}${log.amount}`;
|
|
11880
|
-
const amountColor = isPositive ? "var(--alias-text---icons-success, #1aa055)" : "var(--alias-text---icons-error, #d11a1a)";
|
|
11881
|
-
const rowCellRegular = {
|
|
11882
|
-
color: "var(--alias-text---icons-primary, #f5f5f5)",
|
|
11883
|
-
fontFamily: "var(--font-family-font-family-body)",
|
|
11884
|
-
fontSize: "var(--font-size-font-size-sm, 0.875rem)",
|
|
11885
|
-
fontWeight: 400,
|
|
11886
|
-
lineHeight: "var(--line-height-line-height-sm, 1.25rem)",
|
|
11887
|
-
textOverflow: "ellipsis",
|
|
11888
|
-
overflow: "hidden",
|
|
11889
|
-
whiteSpace: "nowrap"
|
|
11890
|
-
};
|
|
11891
|
-
return /* @__PURE__ */ jsxs26(
|
|
11892
|
-
"div",
|
|
11893
|
-
{
|
|
11894
|
-
style: {
|
|
11895
|
-
borderBottom: "0.0625rem solid var(--alias-border-subtle, #242424)",
|
|
11896
|
-
padding: "8px 16px",
|
|
11897
|
-
display: "flex",
|
|
11898
|
-
flexDirection: "row",
|
|
11899
|
-
gap: "var(--spacing-6xl, 1.5rem)",
|
|
11900
|
-
alignItems: "center"
|
|
11901
|
-
},
|
|
11902
|
-
children: [
|
|
11903
|
-
/* @__PURE__ */ jsx29("div", { style: { ...rowCellRegular, flex: 1 }, children: app }),
|
|
11904
|
-
/* @__PURE__ */ jsx29("div", { style: { ...rowCellRegular, flex: 1 }, children: activity }),
|
|
11905
|
-
/* @__PURE__ */ jsx29("div", { style: { ...rowCellRegular, width: "7.5rem" }, children: userName }),
|
|
11906
|
-
showWorkspace && /* @__PURE__ */ jsx29(
|
|
11907
|
-
"div",
|
|
11908
|
-
{
|
|
11909
|
-
style: {
|
|
11910
|
-
...rowCellRegular,
|
|
11911
|
-
width: "9rem",
|
|
11912
|
-
color: usedBy ? "var(--alias-text---icons-primary, #f5f5f5)" : "var(--alias-text---icons-muted)"
|
|
11913
|
-
},
|
|
11914
|
-
title: workspaceLabel2,
|
|
11915
|
-
children: workspaceLabel2
|
|
11916
|
-
}
|
|
11917
|
-
),
|
|
11918
|
-
/* @__PURE__ */ jsx29("div", { style: { ...rowCellRegular, width: "7.5rem" }, children: formatDate3(log.createdAt) }),
|
|
11919
|
-
/* @__PURE__ */ jsx29(
|
|
11920
|
-
"div",
|
|
11921
|
-
{
|
|
11922
|
-
style: {
|
|
11923
|
-
width: "5rem",
|
|
11924
|
-
color: amountColor,
|
|
11925
|
-
fontFamily: "var(--font-family-font-family-body)",
|
|
11926
|
-
fontSize: "var(--font-size-font-size-md, 1rem)",
|
|
11927
|
-
fontWeight: 600,
|
|
11928
|
-
lineHeight: "var(--line-height-line-height-md, 1.5rem)",
|
|
11929
|
-
textAlign: "right",
|
|
11930
|
-
textOverflow: "ellipsis",
|
|
11931
|
-
overflow: "hidden",
|
|
11932
|
-
whiteSpace: "nowrap"
|
|
11933
|
-
},
|
|
11934
|
-
children: signedAmount
|
|
11935
|
-
}
|
|
11936
|
-
)
|
|
11937
|
-
]
|
|
11938
|
-
},
|
|
11939
|
-
log._id
|
|
11940
|
-
);
|
|
11941
|
-
})
|
|
11942
|
-
]
|
|
11943
|
-
}
|
|
11944
|
-
);
|
|
11940
|
+
]
|
|
11941
|
+
},
|
|
11942
|
+
log._id
|
|
11943
|
+
);
|
|
11944
|
+
})
|
|
11945
|
+
] });
|
|
11945
11946
|
}
|
|
11946
11947
|
function UsageLogsPager({
|
|
11947
11948
|
page,
|
|
@@ -11957,7 +11958,7 @@ function UsageLogsPager({
|
|
|
11957
11958
|
"div",
|
|
11958
11959
|
{
|
|
11959
11960
|
className: "flex items-center justify-between shrink-0 w-full",
|
|
11960
|
-
style: { gap: "var(--spacing-md)" },
|
|
11961
|
+
style: { ...BILLING_TABLE_PAGER_STYLE, gap: "var(--spacing-md)" },
|
|
11961
11962
|
children: [
|
|
11962
11963
|
/* @__PURE__ */ jsxs26(
|
|
11963
11964
|
"span",
|
|
@@ -12098,7 +12099,12 @@ function BillingContent({
|
|
|
12098
12099
|
const [availableCredits, setAvailableCredits] = useState21(null);
|
|
12099
12100
|
const [sharedPool, setSharedPool] = useState21(null);
|
|
12100
12101
|
const [usedByNames, setUsedByNames] = useState21({});
|
|
12101
|
-
const [
|
|
12102
|
+
const [allProducts, setProducts] = useState21([]);
|
|
12103
|
+
const workspaceCountry = workspace.current?.country;
|
|
12104
|
+
const products = useMemo4(
|
|
12105
|
+
() => productsForCountry(allProducts, workspaceCountry),
|
|
12106
|
+
[allProducts, workspaceCountry]
|
|
12107
|
+
);
|
|
12102
12108
|
const [invoices, setInvoices] = useState21([]);
|
|
12103
12109
|
const [totalCredits, setTotalCredits] = useState21(null);
|
|
12104
12110
|
const [usageLogsState, dispatchUsageLogs] = useReducer(
|
|
@@ -12171,17 +12177,7 @@ function BillingContent({
|
|
|
12171
12177
|
if (creditsRes?.availableCredits != null)
|
|
12172
12178
|
setAvailableCredits(creditsRes.availableCredits);
|
|
12173
12179
|
setSharedPool(creditsRes?.sharedPool ?? null);
|
|
12174
|
-
if (productsRes?.data)
|
|
12175
|
-
const normalizedWorkspaceCountry = workspace.current?.country?.trim().toUpperCase();
|
|
12176
|
-
const targetCurrency = normalizedWorkspaceCountry === "IN" ? "inr" : "usd";
|
|
12177
|
-
const filteredProducts = productsRes.data.map((product) => ({
|
|
12178
|
-
...product,
|
|
12179
|
-
prices: product.prices.filter(
|
|
12180
|
-
(price) => price.currency?.toLowerCase() === targetCurrency
|
|
12181
|
-
)
|
|
12182
|
-
})).filter((product) => product.prices.length > 0);
|
|
12183
|
-
setProducts(filteredProducts);
|
|
12184
|
-
}
|
|
12180
|
+
if (productsRes?.data) setProducts(productsRes.data);
|
|
12185
12181
|
if (customRes?.data?.credits != null) {
|
|
12186
12182
|
setCustomPlanCredits(customRes.data.credits);
|
|
12187
12183
|
}
|
|
@@ -12190,7 +12186,7 @@ function BillingContent({
|
|
|
12190
12186
|
setLoadingBilling(false);
|
|
12191
12187
|
setBillingOverviewLoaded(true);
|
|
12192
12188
|
}
|
|
12193
|
-
}, [api
|
|
12189
|
+
}, [api]);
|
|
12194
12190
|
const fetchUserMap = useCallback8(async () => {
|
|
12195
12191
|
try {
|
|
12196
12192
|
const members = await api.fetchMembers();
|
|
@@ -13028,30 +13024,34 @@ function BillingContent({
|
|
|
13028
13024
|
loading: loadingTable,
|
|
13029
13025
|
workspaceCountry: workspace.current?.country
|
|
13030
13026
|
}
|
|
13031
|
-
) :
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
|
|
13036
|
-
|
|
13037
|
-
|
|
13038
|
-
|
|
13039
|
-
|
|
13040
|
-
|
|
13041
|
-
|
|
13042
|
-
|
|
13043
|
-
|
|
13044
|
-
|
|
13045
|
-
|
|
13046
|
-
|
|
13047
|
-
|
|
13048
|
-
|
|
13049
|
-
|
|
13050
|
-
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
|
|
13054
|
-
|
|
13027
|
+
) : (
|
|
13028
|
+
// Table and pager only, so the sticky pager stops at the table's top
|
|
13029
|
+
// and never floats over the cards above it.
|
|
13030
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex flex-col w-full", style: { flex: "1 0 auto" }, children: [
|
|
13031
|
+
/* @__PURE__ */ jsx29(
|
|
13032
|
+
UsageLogsTable,
|
|
13033
|
+
{
|
|
13034
|
+
logs: usageLogs.rows,
|
|
13035
|
+
userMap,
|
|
13036
|
+
loading: loadingUsageLogs,
|
|
13037
|
+
error: usageLogsError,
|
|
13038
|
+
onRetry: () => void loadUsageLogsPage(usageLogsState.requestedPage),
|
|
13039
|
+
currentWorkspaceId: workspaceId,
|
|
13040
|
+
usedByNames
|
|
13041
|
+
}
|
|
13042
|
+
),
|
|
13043
|
+
!usageLogsError && /* @__PURE__ */ jsx29(
|
|
13044
|
+
UsageLogsPager,
|
|
13045
|
+
{
|
|
13046
|
+
page: usageLogs.page,
|
|
13047
|
+
totalPages: usageLogs.totalPages,
|
|
13048
|
+
total: usageLogs.total,
|
|
13049
|
+
loading: loadingUsageLogs,
|
|
13050
|
+
onPageChange: goToUsageLogsPage
|
|
13051
|
+
}
|
|
13052
|
+
)
|
|
13053
|
+
] })
|
|
13054
|
+
),
|
|
13055
13055
|
showExportModal && /* @__PURE__ */ jsx29(
|
|
13056
13056
|
ExportDateModal,
|
|
13057
13057
|
{
|
|
@@ -17423,6 +17423,9 @@ export {
|
|
|
17423
17423
|
AppSettingsPage,
|
|
17424
17424
|
AppSettingsRow,
|
|
17425
17425
|
AppSettingsSection,
|
|
17426
|
+
BILLING_TABLE_FRAME_STYLE,
|
|
17427
|
+
BILLING_TABLE_MIN_HEIGHT,
|
|
17428
|
+
BILLING_TABLE_PAGER_STYLE,
|
|
17426
17429
|
BillingContent,
|
|
17427
17430
|
BuyCreditsModal,
|
|
17428
17431
|
ConfirmDeleteModal,
|
|
@@ -17521,6 +17524,7 @@ export {
|
|
|
17521
17524
|
poolErrorMessage,
|
|
17522
17525
|
poolRenewsAtCycleEnd,
|
|
17523
17526
|
poolWorkspaceName,
|
|
17527
|
+
productsForCountry,
|
|
17524
17528
|
readSettingsCaller,
|
|
17525
17529
|
rememberSettingsCaller,
|
|
17526
17530
|
resolveSettingsTabFromPath,
|