(options?: { includeOrg?: boolean })
| 22 | * plan-derived UI decisions. |
| 23 | */ |
| 24 | export function usePlanView(options?: { includeOrg?: boolean }): UsePlanViewResult { |
| 25 | const { data, isLoading } = useSubscriptionData(options) |
| 26 | const plan = data?.data?.plan |
| 27 | const planView = useMemo(() => derivePlanView(plan), [plan]) |
| 28 | return { |
| 29 | planView, |
| 30 | creditBalance: data?.data?.creditBalance ?? 0, |
| 31 | isLoading, |
| 32 | hasData: Boolean(data?.data), |
| 33 | } |
| 34 | } |
no test coverage detected