mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 01:27:31 +00:00
Correct current plan text in usage and billing
This commit is contained in:
+11
-3
@@ -12,7 +12,7 @@ export const PreviewSection = () => {
|
|||||||
const { subscription, isLoading: isSubscriptionLoading } = useSubscription();
|
const { subscription, isLoading: isSubscriptionLoading } = useSubscription();
|
||||||
const { data, isLoading } = useGetOrgPlanBillingInfo(currentOrg?._id ?? "");
|
const { data, isLoading } = useGetOrgPlanBillingInfo(currentOrg?._id ?? "");
|
||||||
const createCustomerPortalSession = useCreateCustomerPortalSession();
|
const createCustomerPortalSession = useCreateCustomerPortalSession();
|
||||||
|
|
||||||
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpToggle } = usePopUp([
|
||||||
"managePlan"
|
"managePlan"
|
||||||
] as const);
|
] as const);
|
||||||
@@ -35,6 +35,12 @@ export const PreviewSection = () => {
|
|||||||
|
|
||||||
return formattedDate;
|
return formattedDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatPlanSlug(slug: string) {
|
||||||
|
return slug
|
||||||
|
.replace(/(\b[a-z])/g, match => match.toUpperCase())
|
||||||
|
.replace(/-/g, " ");
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -52,11 +58,13 @@ export const PreviewSection = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{!isLoading && data && (
|
{!isLoading && data && subscription && (
|
||||||
<div className="flex mt-8 max-w-screen-lg">
|
<div className="flex mt-8 max-w-screen-lg">
|
||||||
<div className="p-4 bg-mineshaft-900 rounded-lg flex-1 mr-4 border border-mineshaft-600">
|
<div className="p-4 bg-mineshaft-900 rounded-lg flex-1 mr-4 border border-mineshaft-600">
|
||||||
<p className="mb-2 text-gray-400">Current plan</p>
|
<p className="mb-2 text-gray-400">Current plan</p>
|
||||||
<p className="text-2xl mb-8 text-mineshaft-50 font-semibold">Starter</p>
|
<p className="text-2xl mb-8 text-mineshaft-50 font-semibold">
|
||||||
|
{formatPlanSlug(subscription.slug)}
|
||||||
|
</p>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user