@greatapps/common 1.1.397 → 1.1.398
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.
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useActiveSubscription } from "../../subscriptions/hooks/find-active-subscription.hook";
|
|
3
|
+
import { usePlanById } from "./use-plan-by-id.hook";
|
|
3
4
|
function useHasPlanAddon(addonId) {
|
|
4
5
|
const { data: subscriptionData, isLoading: isLoadingSubscription } = useActiveSubscription();
|
|
5
6
|
const activeSubscription = subscriptionData?.data?.[0] ?? null;
|
|
6
|
-
const
|
|
7
|
-
const
|
|
7
|
+
const { data: planData, isLoading: isLoadingPlan } = usePlanById(activeSubscription?.id_plan);
|
|
8
|
+
const hasAddon = !!planData?.data?.items?.some((i) => i.id_addon === addonId);
|
|
9
|
+
const isLoading = isLoadingSubscription || isLoadingPlan;
|
|
8
10
|
return { hasAddon, isLoading };
|
|
9
11
|
}
|
|
10
12
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/plans/hooks/use-has-plan-addon.hook.ts"],"sourcesContent":["'use client';\n\nimport type { AddonKindEnum } from '../../subscriptions/constants/addons.constants';\nimport { useActiveSubscription } from '../../subscriptions/hooks/find-active-subscription.hook';\n\nexport function useHasPlanAddon(addonId: AddonKindEnum) {\n const { data: subscriptionData, isLoading: isLoadingSubscription } = useActiveSubscription();\n const activeSubscription = subscriptionData?.data?.[0] ?? null;\n\n const hasAddon = !!
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/plans/hooks/use-has-plan-addon.hook.ts"],"sourcesContent":["'use client';\n\nimport type { AddonKindEnum } from '../../subscriptions/constants/addons.constants';\nimport { useActiveSubscription } from '../../subscriptions/hooks/find-active-subscription.hook';\nimport { usePlanById } from './use-plan-by-id.hook';\n\nexport function useHasPlanAddon(addonId: AddonKindEnum) {\n const { data: subscriptionData, isLoading: isLoadingSubscription } = useActiveSubscription();\n const activeSubscription = subscriptionData?.data?.[0] ?? null;\n\n const { data: planData, isLoading: isLoadingPlan } = usePlanById(activeSubscription?.id_plan);\n\n const hasAddon = !!planData?.data?.items?.some((i) => i.id_addon === addonId);\n const isLoading = isLoadingSubscription || isLoadingPlan;\n\n return { hasAddon, isLoading };\n}\n"],"mappings":";AAGA,SAAS,6BAA6B;AACtC,SAAS,mBAAmB;AAErB,SAAS,gBAAgB,SAAwB;AACtD,QAAM,EAAE,MAAM,kBAAkB,WAAW,sBAAsB,IAAI,sBAAsB;AAC3F,QAAM,qBAAqB,kBAAkB,OAAO,CAAC,KAAK;AAE1D,QAAM,EAAE,MAAM,UAAU,WAAW,cAAc,IAAI,YAAY,oBAAoB,OAAO;AAE5F,QAAM,WAAW,CAAC,CAAC,UAAU,MAAM,OAAO,KAAK,CAAC,MAAM,EAAE,aAAa,OAAO;AAC5E,QAAM,YAAY,yBAAyB;AAE3C,SAAO,EAAE,UAAU,UAAU;AAC/B;","names":[]}
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
PopoverTrigger,
|
|
14
14
|
UserAvatar,
|
|
15
15
|
} from '../../index';
|
|
16
|
-
import { IconCheck, IconChevronDown, IconFolderOpen
|
|
16
|
+
import { IconCheck, IconChevronDown, IconFolderOpen } from '@tabler/icons-react';
|
|
17
17
|
import type { NavigationProject } from './types';
|
|
18
18
|
|
|
19
19
|
interface ProjectSelectorPopoverProps {
|
|
@@ -96,20 +96,6 @@ export function ProjectSelectorPopover({
|
|
|
96
96
|
<div className="flex flex-col p-3 gap-2">
|
|
97
97
|
<div className="flex items-center justify-between">
|
|
98
98
|
<span className="paragraph-small-semibold">Projetos</span>
|
|
99
|
-
{(onAddProject || onManageProjects) && (
|
|
100
|
-
<div className="flex items-center gap-1.5">
|
|
101
|
-
{onAddProject && (
|
|
102
|
-
<Button
|
|
103
|
-
variant="secondary"
|
|
104
|
-
className="h-8! paragraph-small-semibold text-gray-950"
|
|
105
|
-
onClick={onAddProject}
|
|
106
|
-
>
|
|
107
|
-
<IconPlus size={16} />
|
|
108
|
-
Adicionar
|
|
109
|
-
</Button>
|
|
110
|
-
)}
|
|
111
|
-
</div>
|
|
112
|
-
)}
|
|
113
99
|
</div>
|
|
114
100
|
<Command className="gap-2">
|
|
115
101
|
<CommandInput placeholder="Busque aqui" />
|