mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-10 17:22:15 +01:00
43 lines
844 B
TypeScript
43 lines
844 B
TypeScript
import { usePage } from '@inertiajs/vue3';
|
|
|
|
export function isBillingActivated() {
|
|
const page = usePage<{
|
|
has_billing_extension: boolean;
|
|
}>();
|
|
|
|
return page.props.has_billing_extension;
|
|
}
|
|
|
|
export function isInTrial() {
|
|
const page = usePage<{
|
|
billing: {
|
|
has_trial: boolean;
|
|
};
|
|
}>();
|
|
|
|
return page.props.billing.has_trial;
|
|
}
|
|
export function isBlocked() {
|
|
const page = usePage<{
|
|
billing: {
|
|
is_blocked: boolean;
|
|
};
|
|
}>();
|
|
|
|
return page.props.billing.is_blocked;
|
|
}
|
|
|
|
export function isFreePlan() {
|
|
return !hasActiveSubscription() && !isInTrial();
|
|
}
|
|
|
|
export function hasActiveSubscription() {
|
|
const page = usePage<{
|
|
billing: {
|
|
has_subscription: boolean;
|
|
};
|
|
}>();
|
|
|
|
return page.props.billing.has_subscription;
|
|
}
|